aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-19 11:01:55 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-19 11:01:55 +0000
commit104dd8c92fb2f029a1ae1a44377d552e29d729de (patch)
tree045928112bb21973f4a30166492bf588af0a93d8
parent69172a0900e61d105b486a35064da329c66b6094 (diff)
downloadruby-104dd8c92fb2f029a1ae1a44377d552e29d729de.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
-rw-r--r--lib/net/ftp.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 4c15e23..f439795 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