Bug #6732

documentation error in IPSocket#peeraddr

Added by Joachim Wuttke almost 2 years ago. Updated over 1 year ago.

[ruby-core:46429]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
Category:doc
Target version:1.9.3
ruby -v:ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] Backport:

Description

ri1.9.3 IPSocket#peeraddr
says
TCPSocket.open("www.ruby-lang.org", 80) {|sock|
p sock.peeraddr #=> ["AFINET", 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) #=> ["AFINET", 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)

Associated revisions

Revision 37812
Added by Zachary Scott over 1 year ago

  • ext/socket/ipsocket.c (IPSocket#peeraddr): Fix example [Bug #6732]

History

#1 Updated by Shyouhei Urabe almost 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada

#2 Updated by Zachary Scott over 1 year ago

  • 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.


  • ext/socket/ipsocket.c (IPSocket#peeraddr): Fix example [Bug #6732]

Also available in: Atom PDF