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
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:
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" };
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
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:
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
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