EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElSimpleSSHClient detect closed connection

Posted: 09/17/2009 17:11:34
by Mike Bush (Standard support level)
Joined: 09/17/2009
Posts: 1

Does anyone know if the SimpleSSHClient can detect lost connections? For example if the physical connection was to be broken.

Currently if someone were the close the socket via an improper shutdown (pulling the ethernet cable) the client will always assume the connection is valid unless you call Close() on the client or you try to send data on the wire, at which an exception ("Connection lost (error code is 10038)") is thrown.

The OnCloseConnection event only gets called after the exception is thrown.

If possible I'd like to detect these types of disconnect scenarios without having to "poke" the other end.
Posted: 09/17/2009 23:58:25
by Eugene Mayevski (Team)

TCP is designed to be tolerant to temporary network failures so the only way to know about connection problems is attempt to send something (such as keep-alive packet).

Sincerely yours
Eugene Mayevski



Topic viewed 1011 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!