Project

General

Profile

Actions

Bug #6732

closed

documentation error in IPSocket#peeraddr

Bug #6732: documentation error in IPSocket#peeraddr

Added by JWuttke (Joachim Wuttke) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
Backport:
[ruby-core:46429]

Description

ri1.9.3 IPSocket#peeraddr
says
TCPSocket.open("www.ruby-lang.org", 80) {|sock|
p sock.peeraddr #=> ["AF_INET", 80, "carbon.ruby-lang.org", "221.186.184.68"]
p sock.peeraddr(true) #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"]
p sock.peeraddr(false) #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"]
p sock.peeraddr(:hostname) #=> ["AF_INET", 80, "carbon.ruby-lang.org", "221.186.184.68"]
p sock.peeraddr(:numeric) #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"]
}
the third line is wrong: peeraddr(true) actually returns the same as peeraddr(:hostname)

Updated by shyouhei (Shyouhei Urabe) over 13 years ago Actions #1

  • Status changed from Open to Assigned
  • Assignee set to nobu (Nobuyoshi Nakada)

Updated by zzak (zzak _) almost 13 years ago Actions #2

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r37812.
Joachim, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


Actions

Also available in: PDF Atom