简体   繁体   English

如何使用浏览器中运行的Silverlight处理许多(超过100个)并行HTTP请求?

[英]How can I handle many (more than 100) parallel HTTP-Requests with Silverlight running in a Browser?

I have to do 100 parallel HTTP Requests with my Silverlight application. 我必须使用Silverlight应用程序执行100个并行HTTP请求。 Unfortunately the parallel connections are limited by the Browser. 不幸的是,并行连接受到浏览器的限制。

If I start the Prozess I start all Requests parallel. 如果我启动Prozess,那么我将同时启动所有请求。 The Browser seems to handle only about 10 connection parallel (sth. like max-connections). 浏览器似乎只能处理大约10个并行连接(例如max-connections)。 So all others are waiting. 所以其他所有人都在等待。 If the Browser receives a response, it handles the next WAITING request and so on. 如果浏览器收到响应,它将处理下一个等待请求,依此类推。

My problem is that the last WAITING requests are never handled. 我的问题是,最后的等待请求从未处理过。 Is there a timeout? 有超时吗? If yes - can I control the timeout? 如果是,我可以控制超时吗?

If I implement my own timeout timer, how can I start it (there seems to be a gap between Silverlight starts the request and the Browser handles the request). 如果实现自己的超时计时器,则如何启动它(Silverlight启动请求和浏览器处理该请求之间似乎存在间隙)。

Can I detect the "max-connections" of the Browser to partitionize the 100 requests in smaller chunks? 我可以检测浏览器的“最大连接数”以将100个请求分成较小的块吗?

Now I DO NOT recommend this, but if you create multiple subdomain names for the same server/website and distribute load evenly, you can increase by 10 extra calls per server. 现在,我不建议这样做,但是如果您为同一服务器/网站创建多个子域名并平均分配负载,则每个服务器可以增加10个额外的呼叫。 IE. IE浏览器。 www1.domain.com, www2.domain.com etc. You often see this approach used on Bing and Google maps to load many tiles quickly. www1.domain.com,www2.domain.com等。您经常会在Bing和Google地图上看到这种方法来快速加载许多图块。 But as other people commented your approach is wrong from the get-go. 但是正如其他人所说,一开始您的方法是错误的。 Perhaps consider only calculating a row on demand (IE when,a user requests a specific row to get calculated). 也许考虑只按需计算一行(IE,当用户请求特定的行进行计算时)。 With the TPL async/await extension it would also be fairly easy to chunk it up in n/10 queues and process them one by one. 使用TPL异步/等待扩展,将它分成n / 10个队列并逐个处理它们也很容易。

You can find info of max connections on this page : http://www.browserscope.org/?category=network 您可以在此页面上找到最大连接数的信息: http : //www.browserscope.org/?category=network

Check BrowserInformation to adapte chunk. 检查BrowserInformation以适应块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM