While experimenting with the new Sockets API I have encountered an error. The following is simplified simple code snippet I used:
DatagramSocket socket = new DatagramSocket();
await socket.ConnectAsync("126.96.36.199", "53");
var tcs = new TaskCompletionSource<DatagramSocketMessageReceivedEventArgs>();
socket.MessageReceived += (sender, e) => tcs.SetResult(e);
Now the last line that adds MessageReceived event handler throws a COMException with the helpful text "Unspecified error". Am I doing something wrong or is it possibly a bug (in documentation or my code)?