update rdoc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2010-01-31 09:03:08 +00:00
parent d784451678
commit 8458c38590

View File

@ -502,12 +502,12 @@ sock_listen(VALUE sock, VALUE log)
/* /*
* call-seq: * call-seq:
* socket.recvfrom(maxlen) => [mesg, sender_sockaddr] * socket.recvfrom(maxlen) => [mesg, sender_addrinfo]
* socket.recvfrom(maxlen, flags) => [mesg, sender_sockaddr] * socket.recvfrom(maxlen, flags) => [mesg, sender_addrinfo]
* *
* Receives up to _maxlen_ bytes from +socket+. _flags_ is zero or more * Receives up to _maxlen_ bytes from +socket+. _flags_ is zero or more
* of the +MSG_+ options. The first element of the results, _mesg_, is the data * of the +MSG_+ options. The first element of the results, _mesg_, is the data
* received. The second element, _sender_sockaddr_, contains protocol-specific information * received. The second element, _sender_addrinfo_, contains protocol-specific information
* on the sender. * on the sender.
* *
* === Parameters * === Parameters
@ -522,7 +522,7 @@ sock_listen(VALUE sock, VALUE log)
* sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' ) * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
* socket.bind( sockaddr ) * socket.bind( sockaddr )
* socket.listen( 5 ) * socket.listen( 5 )
* client, client_sockaddr = socket.accept * client, client_addrinfo = socket.accept
* data = client.recvfrom( 20 )[0].chomp * data = client.recvfrom( 20 )[0].chomp
* puts "I only received 20 bytes '#{data}'" * puts "I only received 20 bytes '#{data}'"
* sleep 1 * sleep 1
@ -613,14 +613,14 @@ sock_recvfrom(int argc, VALUE *argv, VALUE sock)
/* /*
* call-seq: * call-seq:
* socket.recvfrom_nonblock(maxlen) => [mesg, sender_sockaddr] * socket.recvfrom_nonblock(maxlen) => [mesg, sender_addrinfo]
* socket.recvfrom_nonblock(maxlen, flags) => [mesg, sender_sockaddr] * socket.recvfrom_nonblock(maxlen, flags) => [mesg, sender_addrinfo]
* *
* Receives up to _maxlen_ bytes from +socket+ using recvfrom(2) after * Receives up to _maxlen_ bytes from +socket+ using recvfrom(2) after
* O_NONBLOCK is set for the underlying file descriptor. * O_NONBLOCK is set for the underlying file descriptor.
* _flags_ is zero or more of the +MSG_+ options. * _flags_ is zero or more of the +MSG_+ options.
* The first element of the results, _mesg_, is the data received. * The first element of the results, _mesg_, is the data received.
* The second element, _sender_sockaddr_, contains protocol-specific information * The second element, _sender_addrinfo_, contains protocol-specific information
* on the sender. * on the sender.
* *
* When recvfrom(2) returns 0, Socket#recvfrom_nonblock returns * When recvfrom(2) returns 0, Socket#recvfrom_nonblock returns
@ -639,7 +639,7 @@ sock_recvfrom(int argc, VALUE *argv, VALUE sock)
* sockaddr = Socket.sockaddr_in(2200, 'localhost') * sockaddr = Socket.sockaddr_in(2200, 'localhost')
* socket.bind(sockaddr) * socket.bind(sockaddr)
* socket.listen(5) * socket.listen(5)
* client, client_sockaddr = socket.accept * client, client_addrinfo = socket.accept
* begin # emulate blocking recvfrom * begin # emulate blocking recvfrom
* pair = client.recvfrom_nonblock(20) * pair = client.recvfrom_nonblock(20)
* rescue IO::WaitReadable * rescue IO::WaitReadable
@ -709,14 +709,13 @@ sock_accept(VALUE sock)
/* /*
* call-seq: * call-seq:
* socket.accept_nonblock => [client_socket, client_sockaddr] * socket.accept_nonblock => [client_socket, client_addrinfo]
* *
* Accepts an incoming connection using accept(2) after * Accepts an incoming connection using accept(2) after
* O_NONBLOCK is set for the underlying file descriptor. * O_NONBLOCK is set for the underlying file descriptor.
* It returns an array containing the accepted socket * It returns an array containing the accepted socket
* for the incoming connection, _client_socket_, * for the incoming connection, _client_socket_,
* and a string that contains the +struct+ sockaddr information * and an Addrinfo, _client_addrinfo_.
* about the caller, _client_sockaddr_.
* *
* === Example * === Example
* # In one script, start this first * # In one script, start this first
@ -727,7 +726,7 @@ sock_accept(VALUE sock)
* socket.bind(sockaddr) * socket.bind(sockaddr)
* socket.listen(5) * socket.listen(5)
* begin # emulate blocking accept * begin # emulate blocking accept
* client_socket, client_sockaddr = socket.accept_nonblock * client_socket, client_addrinfo = socket.accept_nonblock
* rescue IO::WaitReadable, Errno::EINTR * rescue IO::WaitReadable, Errno::EINTR
* IO.select([socket]) * IO.select([socket])
* retry * retry
@ -774,12 +773,11 @@ sock_accept_nonblock(VALUE sock)
/* /*
* call-seq: * call-seq:
* socket.sysaccept => [client_socket_fd, client_sockaddr] * socket.sysaccept => [client_socket_fd, client_addrinfo]
* *
* Accepts an incoming connection returning an array containing the (integer) * Accepts an incoming connection returning an array containing the (integer)
* file descriptor for the incoming connection, _client_socket_fd_, * file descriptor for the incoming connection, _client_socket_fd_,
* and a string that contains the +struct+ sockaddr information * and an Addrinfo, _client_addrinfo_.
* about the caller, _client_sockaddr_.
* *
* === Example * === Example
* # In one script, start this first * # In one script, start this first
@ -789,7 +787,7 @@ sock_accept_nonblock(VALUE sock)
* sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' ) * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
* socket.bind( sockaddr ) * socket.bind( sockaddr )
* socket.listen( 5 ) * socket.listen( 5 )
* client_fd, client_sockaddr = socket.sysaccept * client_fd, client_addrinfo = socket.sysaccept
* client_socket = Socket.for_fd( client_fd ) * client_socket = Socket.for_fd( client_fd )
* puts "The client said, '#{client_socket.readline.chomp}'" * puts "The client said, '#{client_socket.readline.chomp}'"
* client_socket.puts "Hello from script one!" * client_socket.puts "Hello from script one!"