use IO::Socket; use IO::Socket::INET; my $socket = IO::Socket::INET->new( PeerAdr => $my_server, PeerPort => 'ftp(21)', #might be http(80) someday Proto => 'tcp'); my $is_connected = $socket->connected(); $socket->shutdown(2); if(!$is_connected){ #go back to sleep } else{ #do some stuff }
In reply to Re: Re: Checking Server Availability
by Anonymous Monk
in thread Checking Server Availability
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |