summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-05-24 05:06:59 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-05-24 05:06:59 +0000
commit31328e55fe15efa69bec9cfa3e2f5553011ab354 (patch)
tree8d17a2daa79b2974c190decce799696c475baa07 /ext
parent6c3879a612ca8af4339589e6c66c383c23fd7f17 (diff)
update nonblocking methods document.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/socket.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 5f4fe6abe8..7db06ef067 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