G**T 发帖数: 388 | 1 how to use WebClient for multi-connections for one server?
I'm trying to use WebClient to download files from a server. I use
multi-thread, each thread for one file. However, I find that I can only use at
most 2 threads. If I use > 2 threads at the same time, then WebClient will
have some exceptions. I tried to download > 2 files from IE6. It seems we can
only download 2 files at the same by using IE6. The third file won't begin to
be downloaded before one of the first two finished. However, if |
j***e 发帖数: 186 | 2 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
add
"MaxConnectionsPer1_0Server"=Dword:00000010
"MaxConnectionsPerServer"=Dword:00000010
for 16 connections
【在 G**T 的大作中提到】 : how to use WebClient for multi-connections for one server? : I'm trying to use WebClient to download files from a server. I use : multi-thread, each thread for one file. However, I find that I can only use at : most 2 threads. If I use > 2 threads at the same time, then WebClient will : have some exceptions. I tried to download > 2 files from IE6. It seems we can : only download 2 files at the same by using IE6. The third file won't begin to : be downloaded before one of the first two finished. However, if
|
G**T 发帖数: 388 | 3
Settings
a quick check, it works for IE! so, I assume it will work for Vb .NET.
thanks.
I posted this question on www.vbforums.com
no1 can answer. hehe
use at
can
to
Opera,
this
webpages
the
【在 j***e 的大作中提到】 : HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings : add : "MaxConnectionsPer1_0Server"=Dword:00000010 : "MaxConnectionsPerServer"=Dword:00000010 : for 16 connections
|
G**T 发帖数: 388 | 4
Settings
however, it still does not work in Vb .NET program although it works for IE.
how can I make WebClient can have more connections?
thx
use at
can
to
Opera,
this
webpages
the
【在 j***e 的大作中提到】 : HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings : add : "MaxConnectionsPer1_0Server"=Dword:00000010 : "MaxConnectionsPerServer"=Dword:00000010 : for 16 connections
|
st 发帖数: 1685 | 5 ie was based on inetinfo, I think webclient is based on inetinfo as well,
not sure if it has something you can customize...
【在 G**T 的大作中提到】 : : Settings : however, it still does not work in Vb .NET program although it works for IE. : how can I make WebClient can have more connections? : thx : use at : can : to : Opera, : this
|
j***e 发帖数: 186 | 6 Why not try HttpWebResponse ? Maybe it can have more connections.
And it is superior than WebClient. You can check encoding, content type
blah blah.
【在 G**T 的大作中提到】 : : Settings : however, it still does not work in Vb .NET program although it works for IE. : how can I make WebClient can have more connections? : thx : use at : can : to : Opera, : this
|
st 发帖数: 1685 | 7 I guess WebClient is just so easy to use... for basic tasks..
【在 j***e 的大作中提到】 : Why not try HttpWebResponse ? Maybe it can have more connections. : And it is superior than WebClient. You can check encoding, content type : blah blah.
|
G**T 发帖数: 388 | 8
same thing.
IE.
【在 j***e 的大作中提到】 : Why not try HttpWebResponse ? Maybe it can have more connections. : And it is superior than WebClient. You can check encoding, content type : blah blah.
|
G**T 发帖数: 388 | 9
i tried httpwebquest ...., same thing. can not change # of connections
maybe I'm wrong.
IE.
【在 st 的大作中提到】 : I guess WebClient is just so easy to use... for basic tasks..
|
R*********t 发帖数: 217 | 10 check the document for ServicePointManager, but be aware of the
consequences of multiple connections to a single server.
【在 G**T 的大作中提到】 : : i tried httpwebquest ...., same thing. can not change # of connections : maybe I'm wrong. : IE.
|
G**T 发帖数: 388 | 11
yes, ServicePoint is the way to do it. However, it seems no1 recommends to use
it to change connection #.
so I gave up.
IE.
【在 R*********t 的大作中提到】 : check the document for ServicePointManager, but be aware of the : consequences of multiple connections to a single server.
|