diff options
Diffstat (limited to 'ext/socket/lib')
-rw-r--r-- | ext/socket/lib/socket.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb index c9b70433c1..0fbce1ca66 100644 --- a/ext/socket/lib/socket.rb +++ b/ext/socket/lib/socket.rb @@ -232,7 +232,11 @@ class Socket sockets = [] port = nil ai_list.each {|ai| - s = Socket.new(ai.pfamily, ai.socktype, ai.protocol) + begin + s = Socket.new(ai.pfamily, ai.socktype, ai.protocol) + rescue SystemCallError + next + end sockets << s s.ipv6only! if ai.ipv6? s.setsockopt(:SOCKET, :REUSEADDR, 1) |