mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
update rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d784451678
commit
8458c38590
1 changed files with 14 additions and 16 deletions
|
@ -502,12 +502,12 @@ sock_listen(VALUE sock, VALUE log)
|
|||
|
||||
/*
|
||||
* call-seq:
|
||||
* socket.recvfrom(maxlen) => [mesg, sender_sockaddr]
|
||||
* socket.recvfrom(maxlen, flags) => [mesg, sender_sockaddr]
|
||||
* socket.recvfrom(maxlen) => [mesg, sender_addrinfo]
|
||||
* socket.recvfrom(maxlen, flags) => [mesg, sender_addrinfo]
|
||||
*
|
||||
* 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
|
||||
* received. The second element, _sender_sockaddr_, contains protocol-specific information
|
||||
* received. The second element, _sender_addrinfo_, contains protocol-specific information
|
||||
* on the sender.
|
||||
*
|
||||
* === Parameters
|
||||
|
@ -522,7 +522,7 @@ sock_listen(VALUE sock, VALUE log)
|
|||
* sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
|
||||
* socket.bind( sockaddr )
|
||||
* socket.listen( 5 )
|
||||
* client, client_sockaddr = socket.accept
|
||||
* client, client_addrinfo = socket.accept
|
||||
* data = client.recvfrom( 20 )[0].chomp
|
||||
* puts "I only received 20 bytes '#{data}'"
|
||||
* sleep 1
|
||||
|
@ -613,14 +613,14 @@ sock_recvfrom(int argc, VALUE *argv, VALUE sock)
|
|||
|
||||
/*
|
||||
* call-seq:
|
||||
* socket.recvfrom_nonblock(maxlen) => [mesg, sender_sockaddr]
|
||||
* socket.recvfrom_nonblock(maxlen, flags) => [mesg, sender_sockaddr]
|
||||
* socket.recvfrom_nonblock(maxlen) => [mesg, sender_addrinfo]
|
||||
* socket.recvfrom_nonblock(maxlen, flags) => [mesg, sender_addrinfo]
|
||||
*
|
||||
* Receives up to _maxlen_ bytes from +socket+ using recvfrom(2) after
|
||||
* O_NONBLOCK is set for the underlying file descriptor.
|
||||
* _flags_ is zero or more of the +MSG_+ options.
|
||||
* 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.
|
||||
*
|
||||
* 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')
|
||||
* socket.bind(sockaddr)
|
||||
* socket.listen(5)
|
||||
* client, client_sockaddr = socket.accept
|
||||
* client, client_addrinfo = socket.accept
|
||||
* begin # emulate blocking recvfrom
|
||||
* pair = client.recvfrom_nonblock(20)
|
||||
* rescue IO::WaitReadable
|
||||
|
@ -709,14 +709,13 @@ sock_accept(VALUE sock)
|
|||
|
||||
/*
|
||||
* call-seq:
|
||||
* socket.accept_nonblock => [client_socket, client_sockaddr]
|
||||
* socket.accept_nonblock => [client_socket, client_addrinfo]
|
||||
*
|
||||
* Accepts an incoming connection using accept(2) after
|
||||
* O_NONBLOCK is set for the underlying file descriptor.
|
||||
* It returns an array containing the accepted socket
|
||||
* for the incoming connection, _client_socket_,
|
||||
* and a string that contains the +struct+ sockaddr information
|
||||
* about the caller, _client_sockaddr_.
|
||||
* and an Addrinfo, _client_addrinfo_.
|
||||
*
|
||||
* === Example
|
||||
* # In one script, start this first
|
||||
|
@ -727,7 +726,7 @@ sock_accept(VALUE sock)
|
|||
* socket.bind(sockaddr)
|
||||
* socket.listen(5)
|
||||
* begin # emulate blocking accept
|
||||
* client_socket, client_sockaddr = socket.accept_nonblock
|
||||
* client_socket, client_addrinfo = socket.accept_nonblock
|
||||
* rescue IO::WaitReadable, Errno::EINTR
|
||||
* IO.select([socket])
|
||||
* retry
|
||||
|
@ -774,12 +773,11 @@ sock_accept_nonblock(VALUE sock)
|
|||
|
||||
/*
|
||||
* 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)
|
||||
* file descriptor for the incoming connection, _client_socket_fd_,
|
||||
* and a string that contains the +struct+ sockaddr information
|
||||
* about the caller, _client_sockaddr_.
|
||||
* and an Addrinfo, _client_addrinfo_.
|
||||
*
|
||||
* === Example
|
||||
* # In one script, start this first
|
||||
|
@ -789,7 +787,7 @@ sock_accept_nonblock(VALUE sock)
|
|||
* sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
|
||||
* socket.bind( sockaddr )
|
||||
* socket.listen( 5 )
|
||||
* client_fd, client_sockaddr = socket.sysaccept
|
||||
* client_fd, client_addrinfo = socket.sysaccept
|
||||
* client_socket = Socket.for_fd( client_fd )
|
||||
* puts "The client said, '#{client_socket.readline.chomp}'"
|
||||
* client_socket.puts "Hello from script one!"
|
||||
|
|
Loading…
Reference in a new issue