summaryrefslogtreecommitdiff
path: root/ext/socket/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/lib')
-rw-r--r--ext/socket/lib/socket.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index 2723f7b..7c66e8f 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -1,4 +1,5 @@
require 'socket.so'
+require 'io/wait'
class Addrinfo
# creates an Addrinfo object from the arguments.
@@ -54,9 +55,8 @@ class Addrinfo
when 0 # success or EISCONN, other errors raise
break
when :wait_writable
- if !IO.select(nil, [sock], nil, timeout)
+ sock.wait_writable(timeout) or
raise Errno::ETIMEDOUT, 'user specified timeout'
- end
end while true
else
sock.connect(self)