ftp_server_confirmed = False
Dim sock As Socket
sock.Initialize("sock")
sock.Connect(host,port, 5000)
Wait For sock_Connected (Successful As Boolean)
sock.Close
If Successful Then
ftp.Initialize("ftp",host,port,username,password)
Log($"FTP initialized with host=${host}, port=${port}, username=${username}, password=${password}"$)
ftp.PassiveMode = True
ftp.UseSSL = False
ftp.UseSSLExplicit = False
Dim obj As Object = ftp.SendCommand("PWD","")
Wait For (obj) ftp_CommandCompleted (Command As String, Success As Boolean, ReplyCode As Int, ReplyString As String)
Log($"Command = ${Command}, Success = ${Success}, ReplyCode = ${ReplyCode}, ReplyString = ${ReplyString}"$)
ftp_server_confirmed = Success
If Success Then
mHost = host
mPort = port
mUserName = username
mPassword = password
End If
Disconnect
Return Successful
Else
Log($"Unable to initialize FTP with host=${host}, port=${port}"$)
End If
Return False