Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
5.4k views
in .NET FTP by (280 points)
Hi, I need to modify my existing program (which runs through a list of FTP clients and Gets and Puts) so that it uses multiple threads to login to a number of machines simultaneously and Get and Put.

Anyone got any guidelines of how I go about doing this? At the moment I'm thinking of using a ThreadPool to handle x number of connections, then add onto this when one is finished, until the list is complete.

Thanks in advance.

1 Answer

0 votes
by (161k points)
Using ThreadPool would be a sensible choice.

Simply create a pool of a fixed size (e.g. 10 threads), and add all your requests using QueueUserWorkItem. You'll need a WaitCallback delegate to wrap your requests.

As requests complete, queued requests will be processed.

Hi, I need to modify my existing program (which runs through a list of FTP clients and Gets and Puts) so that it uses multiple threads to login to a number of machines simultaneously and Get and Put.

Anyone got any guidelines of how I go about doing this? At the moment I'm thinking of using a ThreadPool to handle x number of connections, then add onto this when one is finished, until the list is complete.

Thanks in advance.

Categories

...