зеркало из https://github.com/github/ruby.git
* lib/rinda/ring.rb (RingFinger#make_socket): Close the socket on exception.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
f64541d7bd
Коммит
09ab3a0a9f
|
@ -1,3 +1,8 @@
|
|||
Sun Jun 1 11:36:25 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* lib/rinda/ring.rb (RingFinger#make_socket): Close the socket on
|
||||
exception.
|
||||
|
||||
Sun Jun 1 06:55:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (intern_str): dynamic attrset ID is registered by
|
||||
|
|
|
@ -413,7 +413,7 @@ module Rinda
|
|||
addrinfo = Addrinfo.udp(address, @port)
|
||||
|
||||
soc = Socket.new(addrinfo.pfamily, addrinfo.socktype, addrinfo.protocol)
|
||||
|
||||
begin
|
||||
if addrinfo.ipv4_multicast? then
|
||||
soc.setsockopt(Socket::Option.ipv4_multicast_loop(1))
|
||||
soc.setsockopt(Socket::Option.ipv4_multicast_ttl(@multicast_hops))
|
||||
|
@ -428,6 +428,10 @@ module Rinda
|
|||
end
|
||||
|
||||
soc.connect(addrinfo)
|
||||
rescue Exception
|
||||
soc.close
|
||||
raise
|
||||
end
|
||||
|
||||
soc
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче