mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/socket/lib/socket.rb (Socket.unix_server_loop): use
unix_server_socket with a block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3f0d724dc3
commit
630e4ef492
2 changed files with 8 additions and 4 deletions
|
@ -645,10 +645,9 @@ class Socket
|
|||
# }
|
||||
#
|
||||
def self.unix_server_loop(path, &b) # :yield: socket, client_addrinfo
|
||||
serv = unix_server_socket(path)
|
||||
accept_loop(serv, &b)
|
||||
ensure
|
||||
serv.close if serv && !serv.closed?
|
||||
unix_server_socket(path) {|serv|
|
||||
accept_loop(serv, &b)
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue