What also helps or might even be necessary, depending on your operating system etc., is turning on SO_KEEPALIVE with set socketopt on your socket. If you set this, you get an error from your socket, especially when doing a select(), if the connection is broken, if you don't set it, you may not.
If you're lucky, your system admin turned this on as a system-wide default, if you're not lucky, or on Linux (where you can't turn this on as a system wide default the last time I looked), you might not be able to detect a broken connection. The SSH keepalive options might mitigate this, but I did not try, so no idea.
_______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
