1

The System.Net.TcpClient object can only connect to an endpoint once. If the client forces the disconnect, then it is clear that the client needs to be replaced. If the server cancels the connection, then it is possible to test the connection and know when it is no longer connected. However once it has been disconnected, I cannot see any property or method that differentiated the disconnected and used client from a disconnected and fresh client.

What is the correct way to test for a disconnected and used client?

J Collins
  • 2,106
  • 1
  • 23
  • 30
  • I made a demo using asynchronous methods of the `TcpClient` and `TcpListener` classes some years back and, from what I can recall, there was no specific wat to tell and the only option was to catch an exception when the connection was used. – jmcilhinney Jul 02 '20 at 00:27

0 Answers0