DTLS.Net
DTLS.Net copied to clipboard
Handle synchronous return of socket.ReceiveFromAsync()
If data is already pending when socket.ReceiveFromAsync() is called, the return value will be set to false. When this happens, the System.Net.Sockets.SocketAsyncEventArgs.Completed event will not be triggered, so we must call it ourselves.
If we fail to call the Completed event ourselves, the DTLS server will stop responding to any incoming data, indefinitely.