Project

General

Profile

Actions

Bug #6732

closed

documentation error in IPSocket#peeraddr

Added by JWuttke (Joachim Wuttke) over 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
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)

Actions #1

Updated by shyouhei (Shyouhei Urabe) over 10 years ago

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

Updated by zzak (Zachary Scott) about 10 years 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.


Actions

Also available in: Atom PDF

Like0
Like0Like0