[前][次][番号順一覧][スレッド一覧]

ruby-changes:10676

From: akr <ko1@a...>
Date: Wed, 11 Feb 2009 17:49:54 +0900 (JST)
Subject: [ruby-changes:10676] Ruby:r22239 (trunk): update rdoc.

akr	2009-02-11 17:49:49 +0900 (Wed, 11 Feb 2009)

  New Revision: 22239

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22239

  Log:
    update rdoc.

  Modified files:
    trunk/ext/socket/lib/socket.rb

Index: ext/socket/lib/socket.rb
===================================================================
--- ext/socket/lib/socket.rb	(revision 22238)
+++ ext/socket/lib/socket.rb	(revision 22239)
@@ -279,7 +279,7 @@
   # 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 @@
   #   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 @@
 
   # 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.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]