[Mono-list] Problem with downloading files in Threads
Robert Jordan
robertj at gmx.net
Tue Dec 26 08:48:50 EST 2006
Sebastian Pölsterl wrote:
> Hi!
>
> I'm trying to write a Downloader that downloads in that case 3 files.
> Downloading is done in a thread while the main thread should print the
> status.
>
> Unfortunatly, if I have 3 files that should be downloaded the last Thread
> never terminates. Whereas, I download 1 or 2 files everything works fine.
>
> I tested it with ThreadPools and Async Threads, but it's always the same
> result.
>
> I can't see any sense in that behavior. I would be more than happy if
> someboy could help me.
According to the HTTP RFC, a client must not maintain more than
2 open connections to the server. WebClient is respecting this
restriction.
You can raise the limit by addding this to your app.confg:
<configuration>
<system.net>
<connectionManagement>
<add name = "*" maxconnection = "10" />
</connectionManagement>
</system.net>
</configuration>
or with
System.Net.ServicePointManager.DefaultConnectionLimit = 10;
Robert
More information about the Mono-list
mailing list