I am trying to figure out the fastest method to upload multiple files over ftp. I have been creating multiple instances of the ftp2 class and using putFile from different threads. Due to some other re-architecture I decided to try a single ftp2 connection but still call putFile from different threads and that did not seem to be well liked. I then tried using the async method and this causes an error of "Async upload already in progress". Now I am looking into the putTree or putPlan methods.
Does anyone have any recommendations of what the best method would be for maximizing my overall upload rate?
asked Nov 20 '14 at 18:03
The Chilkat classes implement the client-side of many protocols: FTP, IMAP, HTTP, SMTP, POP3, SSH, etc. In all cases, except for SSH, there can only be one client-server conversation at a time. This is implicitly defined by the protocol itself. The protocol defines how a conversation proceeds: the client sends a command, the server responds in a well-defined way. The client sends the next command, the server responds, etc. (Or perhaps the client can send N commands, but the server will respond with N responses, where the Nth response is matched to the Nth command.) It should be obvious that it is impossible to overlay multiple conversations on a single connection. Not only do you have the problem of which response belongs to which command, but the conversation is not following the finite-state-machine that is effectively defined by the protocol.
SSH is different because you have different logical channels that can coexist on the same TCP connection, where each channel is a single conversation (i.e. a single FSM).