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
|
@ -1,3 +1,8 @@
|
||||||
|
Wed Feb 11 17:01:52 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/socket/lib/socket.rb (Socket.unix_server_loop): use
|
||||||
|
unix_server_socket with a block.
|
||||||
|
|
||||||
Wed Feb 11 16:54:26 2009 Tanaka Akira <akr@fsij.org>
|
Wed Feb 11 16:54:26 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/lib/socket.rb (Socket.unix_server_socket): close the
|
* ext/socket/lib/socket.rb (Socket.unix_server_socket): close the
|
||||||
|
|
|
@ -645,10 +645,9 @@ class Socket
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
def self.unix_server_loop(path, &b) # :yield: socket, client_addrinfo
|
def self.unix_server_loop(path, &b) # :yield: socket, client_addrinfo
|
||||||
serv = unix_server_socket(path)
|
unix_server_socket(path) {|serv|
|
||||||
accept_loop(serv, &b)
|
accept_loop(serv, &b)
|
||||||
ensure
|
}
|
||||||
serv.close if serv && !serv.closed?
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue