do_not_reverse_lookup 2

basicsocket.do_not_reverse_lookup => true or false
Instance Public methods

Gets the ::do_not_reverse_lookup flag of basicsocket.

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"]
}
doc_ruby_on_rails
2015-03-31 00:44:30
Comments
Leave a Comment

Please login to continue.