Forcibly closed connection C# TCP
Hello, I was working on my Async TCP Server and found that if I connect to it using a TCP mud client and then just close the client, then my EndReceive(...) will throw the following exception: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult) Currently I pretty much just say "Fine whatever" and in the catch I just close the socket on my side and remove the client from the list. Does this seem like a fine way to handle this? I'm not too fond of exception throws for non-errors, but I don't know if it's a real dissconection or not until I have EndReceived
- Newb Programmer: Geek++
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement