summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-10 17:26:17 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-10 17:26:17 +0000
commit94c668f1abec0f861853f5a1b2a9c314d8d26241 (patch)
tree4ce3d10ed9ed621a55cfb55020b6d18470e3625a /ext
parentf86c38212f519e9e6ddeb743ddaf6a95d528c731 (diff)
rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/socket.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 6c4bc41f6be..98657e3763a 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 #=> [#<Socket:fd 6>, #<AddrInfo: 127.0.0.1:48555 TCP>]
+ *
*/
static VALUE
sock_accept(VALUE sock)