Issue #3953 has been updated by mame (Yusuke Endoh).

Target version set to next minor


----------------------------------------
Feature #3953: TCPSocket / UDPSocket do not accept IPAddr objects.
https://bugs.ruby-lang.org/issues/3953#change-33224

Author: postmodern (Hal Brodigan)
Status: Assigned
Priority: Normal
Assignee: knu (Akinori MUSHA)
Category: ext
Target version: next minor


=begin
 I noticed that TCPSocket/UDPSocket only accept String IPs/Hostnames, but not IPAddr objects. This is counter-intuitive since IP Addresses, along with Hostnames, are used to connect/bind to sockets.
 
     require 'socket'
     require 'resolv'
     
     ip = IPAddr.new(Resolv.getaddress('www.example.com'))
     sock = TCPSocket.new(ip,80)
     TypeError: can't convert IPAddr into String
 	from (irb):5:in `initialize'
 	from (irb):5:in `new'
 	from (irb):5
=end



-- 
http://bugs.ruby-lang.org/