On Wed, Mar 07, 2001 at 10:05:32AM +1100, Peter Rundle wrote:
> Got me a perl problem, this code runs fine on Solaris but "hangs"
> on Linux.
>
> The perl wakes up every x minutes, checks if a socket can be
> established to a server on port 80, if so go back to sleep,
> else do something about it. The problem is that the perl hangs
> at the socket open when the server is down. As I said the code
> works fine on solaris.....(doh!), is there something tricky
> about Linux?
>
> $TIMEOUT = 12;
> $HOST_ADDR = "172.16.1.254";
>
> print "opening socket to $HOST_ADDR\n";
> $sock = (IO::Socket::INET->new( PeerAddr => $HOST_ADDR,
> PeerPort => 80,
> Proto => 'tcp',
> Timeout => $TIMEOUT));
>
> The code runs fine when the 172.16.1.254 apache server is up, but
> it just hangs at the socket open when the apache server is down.
>
> Any ideas?
what version of perl does each use?
try stracing both ("truss" on solaris) and see what they are actually
doing.
how about a tcpdump ("snoop" on solaris) ?
does it hang forever (forever = 5minutes+), or just longer than 12 seconds?
--
- Gus
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug