ruby-changes:28418
From: shirosaki <ko1@a...>
Date: Fri, 26 Apr 2013 00:36:51 +0900 (JST)
Subject: [ruby-changes:28418] shirosaki:r40470 (trunk): ring.rb: add a socket to @sockets in make_socket()
shirosaki 2013-04-26 00:36:33 +0900 (Fri, 26 Apr 2013) New Revision: 40470 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40470 Log: ring.rb: add a socket to @sockets in make_socket() * lib/rinda/ring.rb (Rinda::RingServer#initialize): add a socket to @sockets in make_socket() to close sockets on shutdown even if make_socket() is called after initialize. * lib/rinda/ring.rb (Rinda::RingServer#make_socket): ditto. Modified files: trunk/ChangeLog trunk/lib/rinda/ring.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 40469) +++ ChangeLog (revision 40470) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Apr 25 23:45:02 2013 Hiroshi Shirosaki <h.shirosaki@g...> + + * lib/rinda/ring.rb (Rinda::RingServer#initialize): add a socket + to @sockets in make_socket() to close sockets on shutdown even if + make_socket() is called after initialize. + + * lib/rinda/ring.rb (Rinda::RingServer#make_socket): ditto. + Thu Apr 25 23:39:42 2013 Hiroshi Shirosaki <h.shirosaki@g...> * test/rinda/test_rinda.rb (TupleSpaceProxyTest#test_take_bug_8215): Index: lib/rinda/ring.rb =================================================================== --- lib/rinda/ring.rb (revision 40469) +++ lib/rinda/ring.rb (revision 40470) @@ -78,7 +78,8 @@ module Rinda https://github.com/ruby/ruby/blob/trunk/lib/rinda/ring.rb#L78 @renewer = Renewer.new @ts = ts - @sockets = addresses.map do |address| + @sockets = [] + addresses.each do |address| make_socket(address) end @@ -94,6 +95,7 @@ module Rinda https://github.com/ruby/ruby/blob/trunk/lib/rinda/ring.rb#L95 socket = Socket.new(addrinfo.pfamily, addrinfo.socktype, addrinfo.protocol) + @sockets << socket if addrinfo.ipv4_multicast? or addrinfo.ipv6_multicast? then if Socket.const_defined?(:SO_REUSEPORT) then -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/