G
Guest
I have an instance of a TcpClient using a NetworkStream and I want to be able to detect when the connection is lost (or cable unplugged). What is the best way of doing this?
I don't want to use getByte because it reads from the stream.
I tried inheriting TcpClient to access the protected function Client.Connected but this returns true even when the connection has been lost.
Any help is appreciated.
I don't want to use getByte because it reads from the stream.
I tried inheriting TcpClient to access the protected function Client.Connected but this returns true even when the connection has been lost.
Any help is appreciated.