Subject: RE: Detecting broken connection

RE: Detecting broken connection

From: Neil Gierman <ngierman_at_roadrunn.com>
Date: Mon, 12 Jul 2010 11:02:49 -0500

> How would non-blocking help here? As I understand it, if I use
> non-blocking all I do is filter for EAGAIN in a loop. It doesn't
> distinguish other errors from broken connection errors.

In that EAGAIN Loop you should also be able to run select to check the
status of the socket itself.

>
> I'm not very familiar with select. What would the consequences be of
> using it on a socket if libssh2 is in blocking mode?
>
> Thanks.
>

In blocking mode, you don't have the ability to check the socket once you
make the call. If you want to check the status of the socket before you make
the blocking call that would work as well.

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-07-12