Subject: Re: Force deallocate all resources within session

Re: Force deallocate all resources within session

From: Peter Stuge <>
Date: Tue, 5 Mar 2013 17:27:46 +0100

Anton Obukhov wrote:
> > 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?

It depends on what your deciding factor is.

If you want to destroy all connections when interface loses link then
make the kernel do that. It's not the default on Linux but IIRC there
is indeed a setting which does exactly that.

> the internet advises to build keepalive not on the low level
> (sockets), but on a higher level (data exchange logic).

That doesn't make sense to me if the actual event that you want to
trigger on (link loss) is in a lower layer.

Received on 2013-03-05