Android Question FTP.TimeoutMs

Dey

Active Member
Licensed User
Longtime User
Hi everyone
I try to manage a possible error with FTP1.LIST ()
I disable server connection or change ip with an incorrect one
tried to modify TimeoutMs with various values eg.
FTP1.TimeoutMs = 5000
time taken per event about 130 seconds

how to lower this time?
in case of error I check another server
Thanks

Code:
If FTP1.IsInitialized Then
            FTP1.Close
End If
            FTP1.Initialize("ftp","xxxxxxx",port,"xxxxxx","xxxxx")
            FTP1.UseSSL = False
            FTP1.UseSSLExplicit=False
            FTP1.PassiveMode = True
            FTP1.TimeoutMs = 5000
            Dim obj As Object= FTP1.List($"/${FolderName}"$)
            Wait For (obj) ftp_ListCompleted(ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Dey

Active Member
Licensed User
Longtime User
Bad networkconnection? Firewall blocking?
Hi Don
it works properly

I want to handle a possible connection problem,
example I put an incorrect address or I put the server offline.
my problem is I can't edit .TimeoutMs
putting eg. 5000 = 5 seconds response occurs after 130 seconds
 
Upvote 0

teddybear

Well-Known Member
Licensed User
FTP1.TimeoutMs = 5000
The tiemoutMS is transfer timeout, it means ftpserver is online and socket can be connected.it is invalid for an incrrect port or non-existent ftpserver.
 
Upvote 0
Top