Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2006

Tip: Looking for answers? Try searching our database.

WebClient::DownloadFileAsync() Throttling

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Olbert - 11 Mar 2006 20:59 GMT
I have a situation where I would like to manage how fast an http download occurs from a server (basically, the server risks crashing
itself if it goes full bore).

I know there's no download rate paramter for the DownloadFile() methods in WebClient. I was wondering if some other class offers
that capability. Or, failing that, is the DownloadProgressChanged event a blocking call? If it is, I could insert some logic to
delay executing the event handler, thereby slowing down the data transfer rate.

- Mark
Joerg Jooss - 12 Mar 2006 10:07 GMT
Thus wrote Mark,

> I have a situation where I would like to manage how fast an http
> download occurs from a server (basically, the server risks crashing
[quoted text clipped - 9 lines]
> delay executing the event handler, thereby slowing down the data
> transfer rate.

Whether a .NET method call is blocking or not doesn't affect a remote server
sending data. What you would need to do is throttle the traffic at TCP level.
But fixing this on the client side is a doomed approach anyway...

Signature

Joerg Jooss
news-reply@joergjooss.de

Steven Cheng[MSFT] - 13 Mar 2006 08:29 GMT
Hi Mark,

Glad to see you. As for the WebClient class, when we use asynchronous
downloading, the download work is done in a background thread pool  thread,
and the DownloadProgressChanged just work like a one way notification to
inform us the status(the underlying download work continue no matter what
we do in the event handler).  

Also, for the data transfering rate control, generally it is done at raw
TCP/ IP protocol level through some specific component or APIs , it is
beyond the ability of the .NET network components (Like webclient or
httpwebrequest...).  

BTW, if the server-side application is also developed by you, you can
consider controling the rate your server application flush data into the
response stream. For example, in ASP.NET's page or handler code, we can
manually use a loop to write out a file stream into page's response stream.

Anyway, for standard networking transfer rate control, you may have a look
at some general networking programming reference.

Regards,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Mark Olbert - 13 Mar 2006 16:41 GMT
Thanks for the quick reply, Steven.

- Mark
Steven Cheng[MSFT] - 14 Mar 2006 06:40 GMT
You're welcome Mark,

Please feel free to post here when there is anything else we can help.

Regards,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.