diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-09 16:19:37 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-09 16:19:37 +0000 |
commit | 1340851a7c88280419e742f677120faa071e60b6 (patch) | |
tree | 8c7dcf6c1c6db0767971a7d4eb45c4db1efda313 /ext/socket/lib/socket.rb | |
parent | 6d4bf0bfa62ea854badd3dbabe13fbd211c1093b (diff) | |
download | ruby-1340851a7c88280419e742f677120faa071e60b6.tar.gz |
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/lib/socket.rb')
-rw-r--r-- | ext/socket/lib/socket.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb index ad7d1e7aa0..d079ec508e 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) |