RE: Help with socket timeout

2009-12-10 Thread Jeff Saxton
Subject: Re: Help with socket timeout Jeff Saxton wrote: > Why not do it the simple way? > > use IO::Socket; > my $sock = IO::Socket::INET->new($somewhere); > $sock->timeout($n); Have you tried that on Windoze ? ___ ActivePerl ma

Re: Help with socket timeout

2009-12-10 Thread Bill Luebkert
Jeff Saxton wrote: > Why not do it the simple way? > > use IO::Socket; > my $sock = IO::Socket::INET->new($somewhere); > $sock->timeout($n); Have you tried that on Windoze ? ___ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe:

RE: Help with socket timeout

2009-12-10 Thread Jeff Saxton
ursday, December 10, 2009 12:34 PM To: activeperl@listserv.ActiveState.com Subject: Re: Help with socket timeout Angelos Karageorgiou wrote: > > a better way to handle it would be via alarm(ed) timeouts like this > > eval { > local $SIG{ALRM} = sub { die "alarm\n" };

Re: Help with socket timeout

2009-12-10 Thread Bill Luebkert
Angelos Karageorgiou wrote: > > a better way to handle it would be via alarm(ed) timeouts like this > > eval { > local $SIG{ALRM} = sub { die "alarm\n" }; # NB \n required > alarm $timeout; > > A lot of socket work done here > > alarm 0; > }; > die if $@ && $@ ne "alarm\n

Re: Help with socket timeout

2009-12-10 Thread Angelos Karageorgiou
Ken Cornetet wrote: Ping it first with Net::Ping -Original Message- From: activeperl-boun...@listserv.activestate.com [mailto:activeperl-boun...@listserv.activestate.com] On Behalf Of Barry Brevik Sent: Tuesday, December 08, 2009 7:44 PM To: activeperl@listserv.ActiveState.com Subject:

RE: Help with socket timeout

2009-12-09 Thread Ken Cornetet
Ping it first with Net::Ping -Original Message- From: activeperl-boun...@listserv.activestate.com [mailto:activeperl-boun...@listserv.activestate.com] On Behalf Of Barry Brevik Sent: Tuesday, December 08, 2009 7:44 PM To: activeperl@listserv.ActiveState.com Subject: Help with socket timeo

Re: Help with socket timeout

2009-12-08 Thread Michael Ellery
Barry Brevik wrote: > I am using Active Perl 5.8.8 on Windows. > > I am writing an app that opens a TCP socket to a network printer, and > then prints barcode labels on it. When the app starts up, it tries to > determine if the specific printer is reachable or not. > > If the printer is on the