Advertisement

Forcibly closed connection C# TCP

Started by March 04, 2005 07:10 PM
0 comments, last by hplus0603 19 years, 11 months ago
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++
Quote:
Currently I pretty much just say "Fine whatever" and in the catch I just close the socket on my side


That's fine. I don't think they report this non-error in any other way.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement