[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Check if host is available
[Thread Prev] | [Thread Next]
- Subject: Re: Check if host is available
- From: Thomas Mayer <tm.telemotive@xxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 03 Aug 2011 17:31:10 +0200
- To: libssh@xxxxxxxxxx
Hi, Am 03.08.2011 17:16, schrieb Oliver Stöneberg:
Are you sure? Timeout options works in my test program, but only with the ssh_connect() function.if I try to connect to a host via ssh_connect() and the host isn't available the function blocks.did you set a timeout?No, thanks for the advice!That actually didn't work until the 0.5.0 release :)
My idea was to use a QTcpSocket from the Qt lib. If the connection is disconnected you can catch the "disconnected" signal of the socket and then kill the ssh session thread. But till now, it's only a idea and not practically tested ;)This could be the solution for my next problem. I want to detect if someone for example unplugged the network cable while a ssh session is running.I have no idea how to do this, but if this happens libssh is/was prone to hang since there are still polls without an timeout. That's similar to the situation you had with ssh_connect(). I actually encountered a very serious ones, that was actually happening with exec, but I haven't gotten access to a sample machine yet, so I couldn't find out what was going on. It was limited to that custom system though and is reproducible.
Regards, Thomas
Check if host is available | Thomas Mayer <tm.telemotive@xxxxxx> |
Re: Check if host is available | Andreas Schneider <asn@xxxxxxxxxxxxxx> |
Re: Check if host is available | Thomas Mayer <tm.telemotive@xxxxxx> |
Re: Check if host is available | "Oliver Stöneberg" <oliverst@xxxxxxxxx> |