mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e9c8509e87
commit
b721c38f34
2 changed files with 11 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
Thu Apr 25 23:45:02 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
|
||||
|
||||
* 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@gmail.com>
|
||||
|
||||
* test/rinda/test_rinda.rb (TupleSpaceProxyTest#test_take_bug_8215):
|
||||
|
|
|
@ -78,7 +78,8 @@ module Rinda
|
|||
@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
|
|||
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue