Client Disconnected.
-
IS there a way to know if the client is disconnected. My server basically receives data from the client. It uses syncronous connection with a winodw timer (Thus avoiding completly teh multitreading issue.)
-
IS there a way to know if the client is disconnected. My server basically receives data from the client. It uses syncronous connection with a winodw timer (Thus avoiding completly teh multitreading issue.)
This is a very ambiguous question. What client/server technology are you using? A simple TCP socket? .NET Remoting? Web Services?
WebRequest
s? More information would be helpful.Microsoft MVP, Visual C# My Articles
-
This is a very ambiguous question. What client/server technology are you using? A simple TCP socket? .NET Remoting? Web Services?
WebRequest
s? More information would be helpful.Microsoft MVP, Visual C# My Articles
I am using simple TCP sockets.
-
I am using simple TCP sockets.
Then it depends greatly on your implementation. Some protocols - like DICT - will require that a client - if possible - send a QUIT message (or equivalent) for proper implementation. This tells the server that your client is disconnecting. Otherwise, when your server sends data you should catch any exceptions - which you should be doing anyway - and handle them appropriately. If you get a
SocketException
, for instance, check theSocketException.ErrorCode
forWSAECONNRESET
(10054) orWSAENOTCONN
(10057). See the Windows Sockets V2 Error Codes[^] on MSDN for more information.Microsoft MVP, Visual C# My Articles
-
IS there a way to know if the client is disconnected. My server basically receives data from the client. It uses syncronous connection with a winodw timer (Thus avoiding completly teh multitreading issue.)
Open a cmd prompt at your server and type: netstat -a Netstat then displays all connections and listening ports. Check the Microsoft Windows 2000 Server Documentation on Command-line Utilities or type netstat /? for help. Regards, -Ron Sincerely, -Ron