EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Detecting disconnection

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#6812
Posted: 07/01/2008 21:54:38
by Bart Joy (Standard support level)
Joined: 06/08/2008
Posts: 3

To detect if a .NET Socket has been disconnected, it is sufficient to attempt to send data. If the other end point can't be reached, an exception will be thrown.

Is there an equivalent, simple, way to detect when an SSL connection is dropped or the end point is unreachable?
#6817
Posted: 07/02/2008 05:37:13
by Ken Ivanov (EldoS Corp.)

Actually, an attempt of sending some data is not sufficient to detect the connection closure. It is a good idea to use select() (or poll()) calls along with subsequent call to recv().

The same means can be used to detect closure of SSL session. You can both try to send some data to a channel, or use select()/recv() pair.
#6821
Posted: 07/02/2008 07:37:36
by Eugene Mayevski (EldoS Corp.)

Quote
Innokentiy Ivanov wrote:
Actually, an attempt of sending some data is not sufficient to detect the connection closure.


Sending of the data is *the only* documented and recommended way to detect disconnection. The reason is that the TCP packet is sent and receipt is received, and if anything goes wrong, there will be no receipt and disconnection will be reported.


Sincerely yours
Eugene Mayevski
#6822
Posted: 07/02/2008 07:50:31
by Ken Ivanov (EldoS Corp.)

Quote
Sending of the data is *the only* documented and recommended way to detect disconnection.

Yes, though an unusable one in certain situations (e.g., if transfer of extra 'keep-alive' data chunk is not supported by the application layer protocol being used).

Reply

Statistics

Topic viewed 1415 times

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




|

Back to top

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

Got it!