From 023835f47594b348f6d9e213933c2c3f3b4d9a41 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 8 Jul 2015 05:05:27 +0000 Subject: 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/basicsocket.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ext/socket/basicsocket.c b/ext/socket/basicsocket.c index 16fa12dd38..9ecd132259 100644 --- a/ext/socket/basicsocket.c +++ b/ext/socket/basicsocket.c @@ -569,11 +569,13 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock) * * 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) * * 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 -- cgit v1.2.3