diff options
Diffstat (limited to 'ext/socket/socket.c')
-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 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 |