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

ruby-changes:18307

From: akr <ko1@a...>
Date: Fri, 24 Dec 2010 08:52:48 +0900 (JST)
Subject: [ruby-changes:18307] Ruby:r30330 (trunk): update doc.

akr	2010-12-24 08:52:42 +0900 (Fri, 24 Dec 2010)

  New Revision: 30330

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

  Log:
    update doc.

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

Index: ext/socket/ancdata.c
===================================================================
--- ext/socket/ancdata.c	(revision 30329)
+++ ext/socket/ancdata.c	(revision 30330)
@@ -237,15 +237,16 @@
  *   # recvmsg needs :scm_rights=>true for unix_rights
  *   s1, s2 = UNIXSocket.pair
  *   p s1                                         #=> #<UNIXSocket:fd 3>
- *   s1.sendmsg "stdin and a socket", 0, nil, [:SOCKET, :RIGHTS, [0,s1.fileno].pack("ii")]
+ *   s1.sendmsg "stdin and a socket", 0, nil, Socket::AncillaryData.unix_rights(STDIN, s1)
  *   _, _, _, ctl = s2.recvmsg(:scm_rights=>true)
+ *   p ctl                                        #=> #<Socket::AncillaryData: UNIX SOCKET RIGHTS 6 7>
  *   p ctl.unix_rights                            #=> [#<IO:fd 6>, #<Socket:fd 7>]
  *   p File.identical?(STDIN, ctl.unix_rights[0]) #=> true
  *   p File.identical?(s1, ctl.unix_rights[1])    #=> true
  *
  *   # If :scm_rights=>true is not given, unix_rights returns nil
  *   s1, s2 = UNIXSocket.pair
- *   s1.sendmsg "stdin and a socket", 0, nil, [:SOCKET, :RIGHTS, [0,s1.fileno].pack("ii")]
+ *   s1.sendmsg "stdin and a socket", 0, nil, Socket::AncillaryData.unix_rights(STDIN, s1)
  *   _, _, _, ctl = s2.recvmsg
  *   p ctl #=> #<Socket::AncillaryData: UNIX SOCKET RIGHTS 6 7>
  *   p ctl.unix_rights #=> nil

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

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