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"; # propagate errors
>
> # the connection is fine here
> }
Have you tried that on Windoze ? I'm not sure you'll get the
expected results. I don't think timeouts will work on sockets
under Windoze, but you may be able to do something using the
Windows API or using non-blocking I/O on the connect. I don't
have time to experiment right now or I'd give you some better
advice.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs