Subject: | [PATCH] return value on non blocking connect |
The attached patch make IO::Socket::connect behavior similar to
CORE::connect with $sock->blocking(0);
Subject: | IO_Socket.patch |
--- lib/IO/Socket.pm Wed May 27 12:20:07 2009
+++ lib/IO/Socket.pm_new Wed May 27 12:20:01 2009
@@ -142,7 +142,11 @@
$! = $err if $err;
- $err ? undef : $sock;
+ if (!$blocking and $!{EINPROGRESS} or $!{EWOULDBLOCK}) {
+ undef;
+ } else {
+ $err ? undef : $sock;
+ }
}
# Enable/disable blocking IO on sockets.