Working with ftp timeouts
Posted: Sun Oct 21, 2012 9:31 pm
I want to introduce an error check for an ftp server.
Thinking outloud here
I know the default timeout is 10 seconds and can be lowered but as I'm making upto 148 DownloadFile() connections one after the other I would idealy like to check if the ftpserver is reachable first rather than have to deal with 148 timeouts.
Is getting the server state possible from within hollywood ? Or would I have to use the host operating system :-
Eg:-
Execute(C:\Users\xxxxxxx\Desktop\Test\Ping.BAT)
Where Ping.BAT is
ping ftp.server.ip.com > C:\Users\xxxxxxx\Desktop\Test\PingResults.TXT
So I should have a PingResults.TXT file with some thing similar to this in it:-
Reply from nnn.zzz.xxx.yyy: bytes=32 time=101ms TTL=124
Reply from nnn.zzz.xxx.yyy: bytes=32 time=100ms TTL=124
Reply from nnn.zzz.xxx.yyy: bytes=32 time=120ms TTL=124
Reply from nnn.zzz.xxx.yyy: bytes=32 time=120ms TTL=124
could i then do, as you only get a TTL if the server is up , something like below ? (I know the ping time might vary and move the start position of the TTL in the string but thats not an issue.)
OpenFile(1,"C:\Users\xxxxxxx\Desktop\Test\PingResults.TXT, #MODE_READ")
Z$=(ReadLine(1)
If MidStr(Z$,49,3) = "TTL"
.
.
.
DownloadFile()
.
.
.
EndIf
Thinking outloud here
I know the default timeout is 10 seconds and can be lowered but as I'm making upto 148 DownloadFile() connections one after the other I would idealy like to check if the ftpserver is reachable first rather than have to deal with 148 timeouts.
Is getting the server state possible from within hollywood ? Or would I have to use the host operating system :-
Eg:-
Execute(C:\Users\xxxxxxx\Desktop\Test\Ping.BAT)
Where Ping.BAT is
ping ftp.server.ip.com > C:\Users\xxxxxxx\Desktop\Test\PingResults.TXT
So I should have a PingResults.TXT file with some thing similar to this in it:-
Reply from nnn.zzz.xxx.yyy: bytes=32 time=101ms TTL=124
Reply from nnn.zzz.xxx.yyy: bytes=32 time=100ms TTL=124
Reply from nnn.zzz.xxx.yyy: bytes=32 time=120ms TTL=124
Reply from nnn.zzz.xxx.yyy: bytes=32 time=120ms TTL=124
could i then do, as you only get a TTL if the server is up , something like below ? (I know the ping time might vary and move the start position of the TTL in the string but thats not an issue.)
OpenFile(1,"C:\Users\xxxxxxx\Desktop\Test\PingResults.TXT, #MODE_READ")
Z$=(ReadLine(1)
If MidStr(Z$,49,3) = "TTL"
.
.
.
DownloadFile()
.
.
.
EndIf