Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Any Ideas? NIgeThe code fragment is: # this is called to connect to remote host sub connect { my $pack = shift; my ($host,$port) = @_; my $sock = IO::Socket::INET->new(Proto => 'tcp', Type => SOCK_STREAM); return unless $sock; $sock->blocking(0); my $addr = sockaddr_in($port,inet_aton($host)); my $result = $sock->connect($addr); return $sock if $result; # return the socket if connected immediate +ly return $sock if $! == EINPROGRESS; # or if it's in progress return; # return undef on other errors }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IO::Select multiplexing
by Rudif (Hermit) on Jun 30, 2001 at 21:28 UTC | |
|
Re: IO::Select multiplexing
by jepri (Parson) on Jun 30, 2001 at 22:07 UTC |