how to use alarm() to properly time out a connection?

2002-12-20 Thread Ian Zapczynski
Hello all, I need to use alarm to time out a connection to an SFTP server if the connection hangs (I was able to reproduce such a hang using the Secure Shell Server for Windows, so I thought it would be nice if my script assumed this was a possibility). I think I am not understanding the

RE: how to use alarm() to properly time out a connection?

2002-12-20 Thread NYIMI Jose (BMB)
-Original Message- From: Ian Zapczynski [mailto:[EMAIL PROTECTED]] Sent: Friday, December 20, 2002 7:01 PM To: [EMAIL PROTECTED] Subject: how to use alarm() to properly time out a connection? Hello all, I need to use alarm to time out a connection to an SFTP server if the

Re: how to use alarm() to properly time out a connection?

2002-12-20 Thread Ian Zapczynski
Jose, Yes, you are correct. I did not know about placing the alarm prior to the hanging condition (gee, I guess that makes sense) or clearing the alarm afterwards. Thank you! -Ian NYIMI Jose (BMB) wrote: -Original Message- From: Ian Zapczynski [mailto:[EMAIL PROTECTED]] Sent:

Re: how to use alarm() to properly time out a connection?

2002-12-20 Thread Kipp, James
eval { $sftp = Net::SFTP-new($FTPHOST, user=$FTPUSER, password=$FTPPASS); local $SIG{ALRM} = sub { die alarm\n }; alarm 60; }; if ($@) { sendSNMP unless $@ eq alarm\n; } When I run the test code with the endless while loop,

Re: how to use alarm() to properly time out a connection?

2002-12-20 Thread Jenda Krynicky
Date sent: Fri, 20 Dec 2002 13:00:59 -0500 From: Ian Zapczynski [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject:how to use alarm() to properly time out a connection? I need to use alarm to time out a connection to an SFTP server