Subject: Re: Force deallocate all resources within session

Re: Force deallocate all resources within session

From: Anton Obukhov <>
Date: Tue, 5 Mar 2013 02:23:30 +0400

> Why don't you solve this problem at a lower layer in your software stack?
> Just configure your operating system so that the socket returns an
> appropriate error to libssh2.

May I inquire what kind of setting do you suggest to set on the socket so
that it will help the case?
Thing is, the problem is tightly related to the problem of keepalive. There
is none working so far in the library, and the internet advises to build
keepalive not on the low level (sockets), but on a higher level (data
exchange logic).

I tried setting different sockopts on the socket and I can say that in the
case mentioned I got into situation when the network is down, but the
socket never finds out, and if you plug ethernet plug back into the device
an hour after disconnect - it will catch up as if nothing happened.

So I guess relying just on low level socket handling won't work and is at
least not portable.. Which is why I'm looking for a way to destroy session
when my keepalive logic advises so.


Received on 2013-03-04