Skip to content

Commit

Permalink
Get rid of inifinity retry loop in Socket.udp_server_sockets
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
unak committed Apr 9, 2017
1 parent 9638295 commit 49e4df4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ext/socket/lib/socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ def self.udp_server_sockets(host=nil, port)
ip_list << ai
end
}
ip_list.uniq!{|e| e.to_sockaddr}

if port == 0
sockets = ip_sockets_port0(ip_list, false)
Expand Down

0 comments on commit 49e4df4

Please sign in to comment.