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
This commit is contained in:
nobu 2015-07-08 05:05:27 +00:00
parent ee750a8a8b
commit 023835f475

View File

@ -569,11 +569,13 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
* *
* Gets the do_not_reverse_lookup flag of _basicsocket_. * Gets the do_not_reverse_lookup flag of _basicsocket_.
* *
* BasicSocket.do_not_reverse_lookup = false
* TCPSocket.open("www.ruby-lang.org", 80) {|sock| * TCPSocket.open("www.ruby-lang.org", 80) {|sock|
* p sock.do_not_reverse_lookup #=> false * 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 * BasicSocket.do_not_reverse_lookup = true
* p sock.peeraddr #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"] * TCPSocket.open("www.ruby-lang.org", 80) {|sock|
* p sock.do_not_reverse_lookup #=> true
* } * }
*/ */
static VALUE static VALUE
@ -591,10 +593,12 @@ bsock_do_not_reverse_lookup(VALUE sock)
* *
* Sets the do_not_reverse_lookup flag of _basicsocket_. * Sets the do_not_reverse_lookup flag of _basicsocket_.
* *
* BasicSocket.do_not_reverse_lookup = false * TCPSocket.open("www.ruby-lang.org", 80) {|sock|
* p TCPSocket.new("127.0.0.1", 80).do_not_reverse_lookup #=> false * p sock.do_not_reverse_lookup #=> true
* BasicSocket.do_not_reverse_lookup = true * p sock.peeraddr #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"]
* p TCPSocket.new("127.0.0.1", 80).do_not_reverse_lookup #=> true * sock.do_not_reverse_lookup = false
* p sock.peeraddr #=> ["AF_INET", 80, "carbon.ruby-lang.org", "54.163.249.195"]
* }
* *
*/ */
static VALUE static VALUE