I'm scanning a number of machines to perform FTP downloads from them. The machines I'm looking at can be in any of three states:
1. Not be there. Powered down, off the net, etc.
2. There, but no FTP server running.
3. There with the FTP server running.
I have
DIM FTP As FTP
DIM FTP_IP As String
DIM FTP_UN As String
DIM FTP_PW As String
in Process_Globals
Then for each machine I fill in FTP_IP, FTP_UN and FTP_PW then do this:
FTP.Initialize ("FTP", FTP_IP, 21, FTP_UN, FTP_PW)
FTP.Download("Controller.txt", False, File.DirInternal, "Controller.txt")
Then wait for FTP_DownloadCompleted to fire.
In case 1, it eventually does, fails and I can move on to the next machine.
In case 3, it eventually does, fails or succeeds and again I can move on to the next machine.
But in case 2, FTP_DownloadCompleted never fires.
I figured, "no sweat." I'll set up some code to time out, close FTP (Close or CloseNow) and move on to the next machine. The code works, in the sense that the time out occurs and it does what I want. But it does not work in the sense that when it then times out on all future attempts to all machines, including those in case 3. I gather this is because Close and CloseNow don't really work (even though IsInitialized goes to False) until FTP_DownloadComplete fires. Which it never does in case 2.
It appears that even though you can initialize the FTP object for a new server, it's really stuck internally waiting for an event from the earlier machine that never fires.
I tried using something more benign, send the "binary" command. This is fine for case 1 and case 3, but FTP_CommandCompleted never fires for case 2.
What I need, it seems, is a way to abort operations that may be in flight. Is there a way to do that?
- wjl2
1. Not be there. Powered down, off the net, etc.
2. There, but no FTP server running.
3. There with the FTP server running.
I have
DIM FTP As FTP
DIM FTP_IP As String
DIM FTP_UN As String
DIM FTP_PW As String
in Process_Globals
Then for each machine I fill in FTP_IP, FTP_UN and FTP_PW then do this:
FTP.Initialize ("FTP", FTP_IP, 21, FTP_UN, FTP_PW)
FTP.Download("Controller.txt", False, File.DirInternal, "Controller.txt")
Then wait for FTP_DownloadCompleted to fire.
In case 1, it eventually does, fails and I can move on to the next machine.
In case 3, it eventually does, fails or succeeds and again I can move on to the next machine.
But in case 2, FTP_DownloadCompleted never fires.
I figured, "no sweat." I'll set up some code to time out, close FTP (Close or CloseNow) and move on to the next machine. The code works, in the sense that the time out occurs and it does what I want. But it does not work in the sense that when it then times out on all future attempts to all machines, including those in case 3. I gather this is because Close and CloseNow don't really work (even though IsInitialized goes to False) until FTP_DownloadComplete fires. Which it never does in case 2.
It appears that even though you can initialize the FTP object for a new server, it's really stuck internally waiting for an event from the earlier machine that never fires.
I tried using something more benign, send the "binary" command. This is fine for case 1 and case 3, but FTP_CommandCompleted never fires for case 2.
What I need, it seems, is a way to abort operations that may be in flight. Is there a way to do that?
- wjl2