diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-05-24 05:06:59 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-05-24 05:06:59 +0000 |
commit | 9d44833dcf76cc8deee3981f3edc95b11400b224 (patch) | |
tree | 8d17a2daa79b2974c190decce799696c475baa07 | |
parent | 4fa8ed162d413b77dfcc85234f71a9fce5ac5d3f (diff) | |
download | ruby-9d44833dcf76cc8deee3981f3edc95b11400b224.tar.gz ruby-9d44833dcf76cc8deee3981f3edc95b11400b224.tar.xz ruby-9d44833dcf76cc8deee3981f3edc95b11400b224.zip |
update nonblocking methods document.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ext/socket/socket.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 5f4fe6abe..7db06ef06 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -2286,7 +2286,10 @@ sock_connect(sock, addr) * socket.connect_nonblock( sockaddr ) * rescue Errno::EINPROGRESS * IO.select(nil, [socket]) - * socket.connect_nonblock( sockaddr ) + * begin + * socket.connect_nonblock( sockaddr ) + * rescue Errno::EISCONN + * end * end * socket.write( "GET / HTTP/1.0\r\n\r\n" ) * results = socket.read @@ -2623,6 +2626,10 @@ sock_recvfrom(argc, argv, sock) * The first element of the results is the data received. * The second element contains protocol-specific information * on the sender. + * + * When recvfrom(2) returns 0, Socket#recvfrom_nonblock returns + * an empty string as data. + * The meaning depends on the socket: EOF on TCP, empty packet on UDP, etc. * * === Parameters * * +len+ - the number of bytes to receive from the socket @@ -2745,7 +2752,7 @@ sock_accept(sock) * socket.listen( 5 ) * begin * client_socket, client_sockaddr = socket.accept_nonblock - * rescue Errno::EAGAIN + * rescue Errno::EAGAIN, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR * IO.select([socket]) * retry * end |