Redian新闻
>
WebClient for multi-connections?
avatar
WebClient for multi-connections?# DotNet - 窗口里的风景
G*T
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
avatar
j*e
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

avatar
G*T
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

avatar
G*T
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

avatar
st
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

avatar
j*e
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

avatar
st
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.

avatar
G*T
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.

avatar
G*T
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..
avatar
R*t
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.

avatar
G*T
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.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。