summaryrefslogtreecommitdiff
path: root/ext/socket/lib/socket.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-03 15:21:42 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-03 15:21:42 +0000
commit9274fbfae9f9430adb1bce7bdc02e5932448bf20 (patch)
treeb7eae6499d1d42acede97348c5359abd932914e8 /ext/socket/lib/socket.rb
parent5a56fc35ec46acc57300a7c2212d115fe695b4e1 (diff)
* ext/socket/lib/socket.rb (Socket.tcp_server_sockets_port0): skip
socket creation error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/lib/socket.rb')
-rw-r--r--ext/socket/lib/socket.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index c9b70433c14..0fbce1ca66f 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)