Hi All,
I have the following script:
#!/usr/bin/perl use IO::Socket;
my $host=shift @ARGV or die 'need hostname';
my $port=shift @ARGV or die 'need port number';
my [EMAIL PROTECTED] or die 'need timeout';;
my $socket=IO::Socket::INET->new(PeerAddr=> $host,
PeerPort => $port,
Proto => 'tcp',
Type => SOCK_STREAM
Timeout => defined($timeout)?$timeout:1) or die "Can't talk to $host at $port";
When I run it i go: perl test.pl st164.dcs.kcl.ac.uk 139 1
Indicating that I am seeking a status on the connection to the host st164.dcs.kcl.ac.uk and port 139 with a timeout of 1.
When doing this test on a connection that reponds it timesout after 1 second. When I do this on a connection that is live but the port is incorrect it timesout after 1 second. My problem is when the pc is switched off it does not timeout after 1 second.
Doen anyone know what causes this?
# perl --version I am running this on a solairs server perl 5.8 built for Solaris
Regards Otto
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>