summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-19 07:48:32 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-19 07:48:32 +0000
commitee87eb1367f14fe43e58dfb9c528de4fd992a260 (patch)
treeead300989db37caf61cb6dce6c37b9144ff84945 /ext
parent8e8c76bd5f52ed3974448900ce7056628d64c092 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@1923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/socket.c27
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);