diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/socket/socket.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 48058a32fa..49a162149f 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -385,12 +385,6 @@ bsock_send(argc, argv, sock) case EINTR: rb_thread_schedule(); goto retry; - case EWOULDBLOCK: -#if EAGAIN != EWOULDBLOCK - case EAGAIN: -#endif - rb_thread_fd_writable(fd); - goto retry; } rb_sys_fail("send(2)"); } @@ -448,12 +442,6 @@ s_recvfrom(sock, argc, argv, from) case EINTR: rb_thread_schedule(); goto retry; - - case EWOULDBLOCK: -#if EAGAIN != EWOULDBLOCK - case EAGAIN: -#endif - goto retry; } rb_sys_fail("recvfrom(2)"); } @@ -1119,12 +1107,6 @@ s_accept(class, fd, sockaddr, len) case EINTR: rb_thread_schedule(); goto retry; - - case EWOULDBLOCK: -#if EAGAIN != EWOULDBLOCK - case EAGAIN: -#endif - goto retry; } rb_sys_fail(0); } @@ -1345,13 +1327,6 @@ udp_send(argc, argv, sock) case EINTR: rb_thread_schedule(); goto retry; - - case EWOULDBLOCK: -#if EAGAIN != EWOULDBLOCK - case EAGAIN: -#endif - rb_thread_fd_writable(fileno(f)); - goto retry; } } freeaddrinfo(res0); @@ -2188,6 +2163,7 @@ Init_socket() rb_define_singleton_method(rb_cTCPServer, "open", tcp_svr_s_open, -1); rb_define_singleton_method(rb_cTCPServer, "new", tcp_svr_s_open, -1); rb_define_method(rb_cTCPServer, "accept", tcp_accept, 0); + rb_define_method(rb_cTCPServer, "listen", sock_listen, 1); rb_cUDPSocket = rb_define_class("UDPSocket", rb_cIPSocket); rb_define_global_const("UDPsocket", rb_cUDPSocket); @@ -2212,6 +2188,7 @@ Init_socket() rb_define_singleton_method(rb_cUNIXServer, "open", unix_svr_s_open, 1); rb_define_singleton_method(rb_cUNIXServer, "new", unix_svr_s_open, 1); rb_define_method(rb_cUNIXServer, "accept", unix_accept, 0); + rb_define_method(rb_cUNIXServer, "listen", sock_listen, 1); #endif rb_cSocket = rb_define_class("Socket", rb_cBasicSocket); |