aboutsummaryrefslogtreecommitdiffstats
path: root/lib/net/ftp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/ftp.rb')
-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 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