Silverlight 中的异步 Web 服务器调用和最大 HTTP 连接数 [英] Aynchronous web server calls in Silverlight and maximum HTTP connections

查看:23
本文介绍了Silverlight 中的异步 Web 服务器调用和最大 HTTP 连接数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解到 Silverlight 2.0 在与 Web 服务器通信时强加了异步模型.我还没有机会尝试使用 Silverlight,但我认为它使用线程池来管理 .NET Framework 中的线程.

现在,由于某些浏览器,尤其是 Internet Explorer,有一个硬编码限制,最多可以在 Web 服务器上建立两个并发 HTTP 连接,如果我从 Silverlight 发出一堆异步请求会怎样?

Silverlight 是在 Web 浏览器中绕过此限制并打开与可用线程一样多的 HTTP 连接,还是异步请求排队等待两个连接之一变为可用?

I've read that Silverlight 2.0 imposes by design an asynchronous model when communicating with the web server. I haven't had a chance to experiment with Silverlight, but I assume that it uses a thread-pool to manage threads like in the .NET Framework.

Now, since some browsers, most notably Internet Explorer, have an hard-coded limit of maximum two concurrent HTTP connections that can be made on the web server, what happens if I make a bunch of asynchronous requests from Silverlight?

Does Silverlight bypass this limitation in the web browser and open as many HTTP connections as there are threads available, or do the asynchronous requests queue up and wait for one of the two connections to become available?

推荐答案

在 IE 中(尚未测试其他)Silverlight 一次限制为 2 个连接.

In IE (haven't tested others) Silverlight is restricted to 2 connections at a time.

Silverlight 中的行为就是不发出请求.因此,如果您连续发出 5 个异步 Web 服务请求,前 2 个会发生,其他三个不会.我见过的没有例外......

The behavior in Silverlight is to simply not make the request. So if you make 5 Async web service requests right in a row, the first 2 will happen, the other three won't. No exception is thrown that i've seen...

Fiddler 在这里有很大帮助:)

Fiddler is a big help here :)

这篇关于Silverlight 中的异步 Web 服务器调用和最大 HTTP 连接数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆