From d27c1748cd5d41fcf286545d34d7891516dc5e68 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 11 Feb 2009 08:13:20 +0000 Subject: rdoc update. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/lib/socket.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'ext') diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb index a207d5afb8..9b2ee157b7 100644 --- a/ext/socket/lib/socket.rb +++ b/ext/socket/lib/socket.rb @@ -595,9 +595,17 @@ class 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") - # p socket #=> # - # p socket.local_address #=> # + # p socket #=> # + # p socket.local_address #=> # + # + # Socket.unix_server_socket("/tmp/sock") {|s| + # p s #=> # + # p s.local_address #=> # # + # } # def self.unix_server_socket(path) begin -- cgit v1.2.3