From 28aeaa6f674e420c1bf2c35cbe0bf566b7f01de7 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 19 Dec 2001 07:48:32 +0000 Subject: * eval.c (rb_mod_define_method): define_method should follow default method visibility. * eval.c (rb_attr): should warn if the default method visibility is "module_function" (can be error). * eval.c (rb_mod_define_method): should define class/module method also if the visibility is "module_function". * eval.c (rb_mod_define_method): should call hook method "method_added", and "singleton_method_added". * string.c: use RESIZE_CAPA for capacity change. * ext/socket/socket.c (Init_socket): add listen method to TCPServer and UNIXServer. * ext/socket/socket.c (bsock_send): should raise EWOULDBLOCK exception. * ext/socket/socket.c (s_recvfrom): ditto. * ext/socket/socket.c (s_accept): ditto. * ext/socket/socket.c (udp_send): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/socket.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'ext/socket') diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 48058a32f..49a162149 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); -- cgit