I have a pretty simple asynchronous UDP listener, configured as a service, and it has been working pretty well for a while, but recently it crashed into SocketException An existing connection was forcibly closed by the remote host . I have three questions:
- What causes this? (I did not think UDP sockets have a connection)
- How can I duplicate it for testing purposes?
- How can I handle the exception so that everything will work?
My code looks something like this:
private Socket udpSock; private byte[] buffer; public void Starter(){
An exception is thrown in the line recvSock.EndReceiveFrom ().
c # asynchronous udp socketexception
chezy525
source share