diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-08 05:05:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-08 05:05:27 +0000 |
commit | 023835f47594b348f6d9e213933c2c3f3b4d9a41 (patch) | |
tree | a78d38af9f4a30d02f041b9f94642e74747c5ee3 /ext/socket/basicsocket.c | |
parent | ee750a8a8b469f6c022d5096ab287d51a8c1b3de (diff) |
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
Diffstat (limited to 'ext/socket/basicsocket.c')
-rw-r--r-- | ext/socket/basicsocket.c | 18 |
1 files 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 |