[前][次][番号順一覧][スレッド一覧]

ruby-changes:46180

From: usa <ko1@a...>
Date: Mon, 10 Apr 2017 01:19:42 +0900 (JST)
Subject: [ruby-changes:46180] usa:r58293 (trunk): Get rid of inifinity retry loop in Socket.udp_server_sockets

usa	2017-04-10 01:19:37 +0900 (Mon, 10 Apr 2017)

  New Revision: 58293

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58293

  Log:
    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.

  Modified files:
    trunk/ext/socket/lib/socket.rb
Index: ext/socket/lib/socket.rb
===================================================================
--- ext/socket/lib/socket.rb	(revision 58292)
+++ ext/socket/lib/socket.rb	(revision 58293)
@@ -897,6 +897,7 @@ class Socket < BasicSocket https://github.com/ruby/ruby/blob/trunk/ext/socket/lib/socket.rb#L897
         ip_list << ai
       end
     }
+    ip_list.uniq!{|e| e.to_sockaddr}
 
     if port == 0
       sockets = ip_sockets_port0(ip_list, false)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]