ruby-changes:39112
From: nobu <ko1@a...>
Date: Wed, 8 Jul 2015 14:05:53 +0900 (JST)
Subject: [ruby-changes:39112] nobu:r51193 (trunk): basicsocket.c: swap examples [ci skip]
nobu 2015-07-08 14:05:27 +0900 (Wed, 08 Jul 2015) New Revision: 51193 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51193 Log: basicsocket.c: swap examples [ci skip] * ext/socket/basicsocket.c (bsock_do_not_reverse_lookup), (bsock_do_not_reverse_lookup_set): [DOC] swap examples. the code setting the flag is for the setter. Modified files: trunk/ext/socket/basicsocket.c Index: ext/socket/basicsocket.c =================================================================== --- ext/socket/basicsocket.c (revision 51192) +++ ext/socket/basicsocket.c (revision 51193) @@ -569,11 +569,13 @@ rsock_bsock_send(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/ext/socket/basicsocket.c#L569 * * Gets the do_not_reverse_lookup flag of _basicsocket_. * + * BasicSocket.do_not_reverse_lookup = false * TCPSocket.open("www.ruby-lang.org", 80) {|sock| * p sock.do_not_reverse_lookup #=> false - * p sock.peeraddr #=> ["AF_INET", 80, "carbon.ruby-lang.org", "221.186.184.68"] - * sock.do_not_reverse_lookup = true - * p sock.peeraddr #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"] + * } + * BasicSocket.do_not_reverse_lookup = true + * TCPSocket.open("www.ruby-lang.org", 80) {|sock| + * p sock.do_not_reverse_lookup #=> true * } */ static VALUE @@ -591,10 +593,12 @@ bsock_do_not_reverse_lookup(VALUE sock) https://github.com/ruby/ruby/blob/trunk/ext/socket/basicsocket.c#L593 * * Sets the do_not_reverse_lookup flag of _basicsocket_. * - * BasicSocket.do_not_reverse_lookup = false - * p TCPSocket.new("127.0.0.1", 80).do_not_reverse_lookup #=> false - * BasicSocket.do_not_reverse_lookup = true - * p TCPSocket.new("127.0.0.1", 80).do_not_reverse_lookup #=> true + * TCPSocket.open("www.ruby-lang.org", 80) {|sock| + * p sock.do_not_reverse_lookup #=> true + * p sock.peeraddr #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"] + * sock.do_not_reverse_lookup = false + * p sock.peeraddr #=> ["AF_INET", 80, "carbon.ruby-lang.org", "54.163.249.195"] + * } * */ static VALUE -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/