summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-09 16:19:37 (GMT)
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-09 16:19:37 (GMT)
commit49e4df486192bf36e4538369298628e30680acce (patch)
tree8c7dcf6c1c6db0767971a7d4eb45c4db1efda313 /ext/socket
parent963829552795668dc5b04c3a40bb52161bcd1076 (diff)
Get rid of inifinity retry loop in Socket.udp_server_sockets
* ext/socket/lib/socket.rb (Socket.udp_server_sockets): remove duplicated addresses before passing it to ip_sockets_port0 because it causes Errno::EADDRINUSE and retry forever. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/lib/socket.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index ad7d1e7..d079ec5 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -897,6 +897,7 @@ class Socket < BasicSocket
ip_list << ai
end
}
+ ip_list.uniq!{|e| e.to_sockaddr}
if port == 0
sockets = ip_sockets_port0(ip_list, false)