Page 1 of 1

ssh2_connect. How to specify the timeout

Posted: Mon Nov 03, 2008 3:14 pm
by pgb205
I have multiple machines on which I want to execute a particular command. Some of those machines are possibly not
on the network. When I do sshconnection=ssh2_connect(suername,password,port) it works quickly for the machines
that are on the network but drags on forever when it hits a machine that is down. Is there a way to specify a timeout
for ssh2_connect (or for any php command, I guess) so that the script moves on instead of waiting.

thanks bunch in advance for all the replies.

Re: ssh2_connect. How to specify the timeout

Posted: Mon Nov 03, 2008 4:36 pm
by infolock
Look into using rsync command, might help you out.

Re: ssh2_connect. How to specify the timeout

Posted: Tue Apr 19, 2011 5:13 am
by eugenevdm
I also want to know how to specify the timeout for ssh2_connect. I did some manual tests and it appears to be one minute. This is very long and I would like to shorten it considerably.