I write my own telnet client. And I have one problem and cannot to solve it. I connect to the device and communicate with it successfully, but in some moment device disconnect.
When I use Zoc terminal it write "[TELNET] INFO: DISCONNECTED" in this case.
When I use my own terminal I cannot to recognize this case. Property "Connected" in TcpClient is True. I will receive exception when I try to write something into stream after disconnection. But this is too late.
How I can recognize that connection lost?
Thanks.