[twsocket] FTP Async/FTP not ready...
Sat, 03 Jun 2000 16:56:19 -0500
Ok, first of all you have to understand the diff between SYNC and ASYNC
methods. SYNC methods are called BLOCKING and do NOT return until it's job
is done!!! Allows for nice program flow and keeps you logic in one spot.
ASYNC is more of a DELAYED response. For example: You do a connect async
command, when the function comes back, you are NOT GUARANTEED that the
connection is made!!!!! You are only guaranteed that the REQUEST to make the
connection has started. There is an event that handles when the connection
is conplete. In that event, you can then issue maybe your CWD async command
and then it TOO has an event that tells you when ITS done. And then in THAT
event, you can tell it do to the FTP PUT asyunc command. ANd IT TOO has an
event that tells you when it's done.
So, hasically if you want to keep all your code logic together and in one
spot, use the SYNC methods, and if you want the MAXIMUM efficiency with NO
wasted CPU time, then use the ASYNC.
NOTE: The diffference between async and sync have been discussed a lot on
here and "personally" I like the SYNC commands for things that finish
quickly and ASYNC for things that MAY take awhile. I have also written my
own WaitUntilReady function for my ASYNC commands that is very efficient
(ZERO loss in CPU cycles). That way I can EMULATE the sync commands and have
nice logic flow, WHILE being very efficient.
TIP: If your app is a quick & dirty app and you don't care about saving
every last ounce of CPU time, then use the SYNC methods.
Christopher Johnson wrote:
> I want to string FTPClient Async commands to connect, cwd and put a file
> on a server all in one event. Problem is after executing any command,
> the next command results in a FTP component not ready error.
> How does one get past this?
> Chris Johnson
> TWSocket mailing list [http://elists.org/mailman/listinfo/twsocket]
> Visit our website at http://www.rtfm.be/fpiette/indexuk.htm