[前][次][番号順一覧][スレッド一覧]

ruby-changes:27698

From: akr <ko1@a...>
Date: Thu, 14 Mar 2013 12:49:42 +0900 (JST)
Subject: [ruby-changes:27698] akr:r39750 (trunk): update doc.

akr	2013-03-14 12:49:30 +0900 (Thu, 14 Mar 2013)

  New Revision: 39750

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39750

  Log:
    update doc.

  Modified files:
    trunk/ext/socket/socket.c

Index: ext/socket/socket.c
===================================================================
--- ext/socket/socket.c	(revision 39749)
+++ ext/socket/socket.c	(revision 39750)
@@ -142,6 +142,14 @@ rsock_socketpair(int domain, int type, i https://github.com/ruby/ruby/blob/trunk/ext/socket/socket.c#L142
  * _protocol_ should be a protocol defined in the domain,
  * defaults to 0 for the domain.
  *
+ *   s1, s2 = Socket.pair(:UNIX, :STREAM, 0)
+ *   s1.send "a", 0
+ *   s1.send "b", 0
+ *   s1.close
+ *   p s2.recv(10) #=> "ab"
+ *   p s2.recv(10) #=> ""
+ *   p s2.recv(10) #=> ""
+ *
  *   s1, s2 = Socket.pair(:UNIX, :DGRAM, 0)
  *   s1.send "a", 0
  *   s1.send "b", 0

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]