summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-11 08:49:49 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-11 08:49:49 +0000
commita2c779be35d7721a1e067227086a5458f9a16f9a (patch)
tree7804027712b5b7ec34f10f77b0d114df20df16c0 /ext
parent83eddaad27990c840ac186cc6cb8941aeb356caf (diff)
update rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/lib/socket.rb20
1 files changed, 13 insertions, 7 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index 4f2e7294ac..f83e9d6e05 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -279,7 +279,7 @@ class Socket
# creates TCP server sockets for _host_ and _port_.
# _host_ is optional.
#
- # If a block is not given,
+ # If no block given,
# it returns an array of listening sockets.
#
# If a block is given, the block is called with the sockets.
@@ -421,16 +421,22 @@ class Socket
# Socket.udp_server_sockets([host, ] port)
#
# Creates UDP sockets for a UDP server.
- # It returns an array of sockets.
+ #
+ # If no block given, it returns an array of sockets.
+ #
+ # If a block is given, the block is called with the sockets.
+ # The value of the block is returned.
+ # The sockets are closed when this method returns.
#
# If _port_ is zero, some port is choosen.
# But the choosen port is used for the all sockets.
#
# # UDP echo server
- # sockets = Socket.udp_server_sockets(0)
- # p sockets.first.local_address.ip_port #=> 32963
- # Socket.udp_server_loop_on(sockets) {|msg, msg_src|
- # msg_src.reply msg
+ # Socket.udp_server_sockets(0) {|sockets|
+ # p sockets.first.local_address.ip_port #=> 32963
+ # Socket.udp_server_loop_on(sockets) {|msg, msg_src|
+ # msg_src.reply msg
+ # }
# }
#
def self.udp_server_sockets(host=nil, port)
@@ -612,7 +618,7 @@ class Socket
# creates UNIX server sockets on _path_
#
- # If a block is not given, it returns a listening socket.
+ # If no block given, 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.