rdoc update.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-02-11 08:13:20 +00:00
parent 630e4ef492
commit d27c1748cd

View File

@ -595,9 +595,17 @@ class Socket
# #
# It returns a listening socket. # It returns a listening socket.
# #
# If a block is given, it is called with the socket and the block value is returned.
# When the block exits, the socket is closed and the socket file is removed.
#
# socket = Socket.unix_server_socket("/tmp/s") # socket = Socket.unix_server_socket("/tmp/s")
# p socket #=> #<Socket:fd 3> # p socket #=> #<Socket:fd 3>
# p socket.local_address #=> #<Addrinfo: /tmp/s SOCK_STREAM> # p socket.local_address #=> #<Addrinfo: /tmp/s SOCK_STREAM>
#
# Socket.unix_server_socket("/tmp/sock") {|s|
# p s #=> #<Socket:fd 3>
# p s.local_address #=> # #<Addrinfo: /tmp/sock SOCK_STREAM>
# }
# #
def self.unix_server_socket(path) def self.unix_server_socket(path)
begin begin