[Mono-list] Problem with downloading files in Threads

Sebastian Pölsterl marduk at k-d-w.org
Wed Dec 27 05:41:43 EST 2006


Robert Jordan wrote:
> 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;
>
>
I didn't know that. Thanks a lot for your hint.

-- 
Greetings,
Sebastian Pölsterl


More information about the Mono-list mailing list