FTP download and bacgroundworker
-
Hi, In my application, I use FTP do download single .txt file from multiple devices (up to 100 devices, each with its own IP_adress). At the moment I use single bacground worker, which contains single for loop and goes from first to last device and downloads file to local computer (size of each file up to 5 MB). Is it better to implement separate backgroudworker for each device, and download files simultaneously and what would be the best approach?
-
Hi, In my application, I use FTP do download single .txt file from multiple devices (up to 100 devices, each with its own IP_adress). At the moment I use single bacground worker, which contains single for loop and goes from first to last device and downloads file to local computer (size of each file up to 5 MB). Is it better to implement separate backgroudworker for each device, and download files simultaneously and what would be the best approach?
Maybe this lnk http://www.microsoft.com/uk/msdn/screencasts/screencast/294/how-to-use-task-and-taskmanager-classes.aspx[^] helps you out. It is about Task and TaskManager in .NET. You can then make these downloads based from a queue. Please see the video in the link before you respond to me.
In Word you can only store 2 bytes. That is why I use Writer.
-
Hi, In my application, I use FTP do download single .txt file from multiple devices (up to 100 devices, each with its own IP_adress). At the moment I use single bacground worker, which contains single for loop and goes from first to last device and downloads file to local computer (size of each file up to 5 MB). Is it better to implement separate backgroudworker for each device, and download files simultaneously and what would be the best approach?
-
Hi, In my application, I use FTP do download single .txt file from multiple devices (up to 100 devices, each with its own IP_adress). At the moment I use single bacground worker, which contains single for loop and goes from first to last device and downloads file to local computer (size of each file up to 5 MB). Is it better to implement separate backgroudworker for each device, and download files simultaneously and what would be the best approach?
This "problem" is basically the same as your earlier one, so I suggest you read this thread[^] again! :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
This "problem" is basically the same as your earlier one, so I suggest you read this thread[^] again! :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
I agree it is similar, but not exactly the same. For pinging I used for loop with
PingIP.DoAsyncPing(IPadress[i]);
and it works asynchronous. I guess I could create backgroundworkers dynamically (for each ftp download) and run them asynchronous. As I am new to multithreading, I still having trouble differentiating between backgroundworker, thread, thread pool, tasks ... Basicly I want to create multithread application with different threads (tasks): 1) scan network for devices (if connected) 2) download files using ftp 3) read from files 4) processing file content 5) some actions, based upon proccessed data -
I agree it is similar, but not exactly the same. For pinging I used for loop with
PingIP.DoAsyncPing(IPadress[i]);
and it works asynchronous. I guess I could create backgroundworkers dynamically (for each ftp download) and run them asynchronous. As I am new to multithreading, I still having trouble differentiating between backgroundworker, thread, thread pool, tasks ... Basicly I want to create multithread application with different threads (tasks): 1) scan network for devices (if connected) 2) download files using ftp 3) read from files 4) processing file content 5) some actions, based upon proccessed dataperopata wrote:
I used for loop with PingIP.DoAsyncPing(IPadress[i]);
that wasn't my recommendation.
peropata wrote:
I could create backgroundworkers dynamically (for each ftp download)
That would be very expensive. Read the other thread again!
peropata wrote:
I still having trouble differentiating between backgroundworker, thread, thread pool
They basically are all the same. ThreadPool lends you pre-existing threads (that is cheaper) with very little control. BackgroundWorker is a Thread with some goodies added to it, would probably be OK for your needs. Warning: BGW needs several properties set true before it starts behaving well! :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
peropata wrote:
I used for loop with PingIP.DoAsyncPing(IPadress[i]);
that wasn't my recommendation.
peropata wrote:
I could create backgroundworkers dynamically (for each ftp download)
That would be very expensive. Read the other thread again!
peropata wrote:
I still having trouble differentiating between backgroundworker, thread, thread pool
They basically are all the same. ThreadPool lends you pre-existing threads (that is cheaper) with very little control. BackgroundWorker is a Thread with some goodies added to it, would probably be OK for your needs. Warning: BGW needs several properties set true before it starts behaving well! :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.