diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-19 11:01:55 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-19 11:01:55 +0000 |
commit | 73199e1e82b02cd0a9c487bbee533f4398755b19 (patch) | |
tree | 045928112bb21973f4a30166492bf588af0a93d8 /lib | |
parent | 77403c88cd69af1dba72fe0596633435ce665e0d (diff) | |
download | ruby-73199e1e82b02cd0a9c487bbee533f4398755b19.tar.gz |
Use Socket instead of TCPSocket/TCPServer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/ftp.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index 4c15e230ef..f439795e96 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -311,7 +311,7 @@ module Net # Constructs a socket with +host+ and +port+. # # If SOCKSSocket is defined and the environment (ENV) defines - # SOCKS_SERVER, then a SOCKSSocket is returned, else a TCPSocket is + # SOCKS_SERVER, then a SOCKSSocket is returned, else a Socket is # returned. def open_socket(host, port) # :nodoc: return Timeout.timeout(@open_timeout, Net::OpenTimeout) { @@ -319,7 +319,7 @@ module Net @passive = true sock = SOCKSSocket.open(host, port) else - sock = TCPSocket.open(host, port) + sock = Socket.tcp(host, port) end } end @@ -507,7 +507,7 @@ module Net # Constructs a TCPServer socket def makeport # :nodoc: - TCPServer.open(@bare_sock.local_address.ip_address, 0) + Addrinfo.tcp(@bare_sock.local_address.ip_address, 0).listen end private :makeport @@ -557,7 +557,7 @@ module Net if !resp.start_with?("1") raise FTPReplyError, resp end - conn = sock.accept + conn, peeraddr = sock.accept sock.shutdown(Socket::SHUT_WR) rescue nil sock.read rescue nil ensure |