method
sendport
v2_4_6 -
Show latest stable
- Class:
Net::FTP
sendport(host, port)private
Constructs and send the appropriate PORT (or EPRT) command
# File lib/net/ftp.rb, line 512
def sendport(host, port) # :nodoc:
remote_address = @bare_sock.remote_address
if remote_address.ipv4?
cmd = "PORT " + (host.split(".") + port.divmod(256)).join(",")
elsif remote_address.ipv6?
cmd = sprintf("EPRT |2|%s|%d|", host, port)
else
raise FTPProtoError, host
end
voidcmd(cmd)
end Related methods
- Instance methods
- abort
- acct
- binary=
- chdir
- close
- closed?
- connect
- delete
- dir
- get
- getbinaryfile
- getdir
- gettextfile
- help
- list
- login
- ls
- mdtm
- mkdir
- mlsd
- mlst
- mtime
- nlst
- noop
- put
- putbinaryfile
- puttextfile
- pwd
- quit
- read_timeout=
- rename
- retrbinary
- retrlines
- return_code
- return_code=
- rmdir
- sendcmd
- set_socket
- site
- size
- status
- storbinary
- storlines
- system
- voidcmd
- Class methods
- default_passive
- default_passive=
- new
- open
- Private methods
-
get_body -
getline -
getmultiline -
getresp -
makepasv -
makeport -
open_socket -
parse227 -
parse228 -
parse229 -
parse257 -
parse_mlsx_entry -
parse_pasv_ipv4_host -
parse_pasv_ipv6_host -
parse_pasv_port -
putline -
sanitize -
send_type_command -
sendport -
start_tls_session -
transfercmd -
voidresp -
with_binary