diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 6c4bc41f6b..98657e3763 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -3701,6 +3701,16 @@ sock_recvfrom_nonblock(int argc, VALUE *argv, VALUE sock) /* * call-seq: * socket.accept => [client_socket, client_addrinfo] + * + * Accepts a next connection. + * Returns a new Socket object and AddrInfo object. + * + * serv = Socket.new(:INET, :STREAM, 0) + * serv.listen(5) + * c = Socket.new(:INET, :STREAM, 0) + * c.connect(serv.local_address) + * p serv.accept #=> [#, #] + * */ static VALUE sock_accept(VALUE sock)