问题标签 [two-connection-limit]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
150 浏览

ajax - 您实施了哪些解决方法/应对策略来处理多个选项卡与两个连接限制问题?

当您同时打开多个选项卡时,两个连接限制可能会特别麻烦。除了“忽略问题”之外,尽管有两个连接限制,您还见过哪些应对机制让多个选项卡都执行高度交互的 Ajax?

0 投票
2 回答
697 浏览

silverlight - Silverlight MultiScaleImage 连接限制?

Silverlight 的 MultiScaleImage 似乎只允许两个同时连接来请求磁贴,而与子域或浏览器连接限制无关。这使得平移或缩放 DeepZoom 图像非常缓慢。

如何覆盖此连接限制?

Silverlight 似乎不支持 .Net 应用程序使用的通常的 app.config/maxConnections 设置。

编辑:我已经能够使用 Fiddler 验证同时连接的数量。我们应用程序的旧版本(用 ASP.net 编写)使用 IE 中的所有可用连接,但在 Silverlight 中的 MultiScaleImage 控件中呈现的相同图块一次只请求两个。

0 投票
1 回答
701 浏览

c# - 服务调用在主线程中工作,但在多线程时崩溃

我的公司有一个应用程序,可以跟踪与托管在各种机器上的网站相关的信息。中央服务器运行 Windows 服务,该服务获取要检查的站点列表,然后查询在这些目标站点上运行的服务以获取可用于更新本地数据的响应。

我的任务是对这个过程应用多线程,以减少运行所有站点所需的时间(几乎 3000 个站点需要大约 8 小时才能顺序运行)。该服务在不是多线程时成功运行,但是当我将工作分散到多个线程(现在使用 3 个测试,加上一个观察者线程)时,出现了一个奇怪的崩溃,似乎源于对远程服务的调用应该提供数据。这是一个 SOAP/XML 调用。

在测试服务器上运行时,服务只是放弃并且没有完成它的任务,但不会停止运行。当通过调试器(Dev Studio 2010)运行时,整个事情就停止了。我会运行它,几秒钟后它会停止调试,但不是因为它完成了。它不会抛出异常或给我任何类型的消息。有了断点,我可以走到它刚刚停止的地方。事件记录将我带到同一个地方。它停在试图从其他站点上的 Web 服务获取响应的代码行上。再说一遍:它只在多线程时才这样做。

我发现一些信息表明默认为 2 的连接数有限制。建议的解决方案是在 app.config 中添加一些标签,但这并没有解决问题......

我仍然认为这可能与允许的连接数有关,但我一直无法很好地在网上找到有关它的信息。有什么简单的我想念的吗?任何帮助将非常感激。

0 投票
3 回答
2245 浏览

http - Adobe AIR HTTP 连接限制

我正在开发一个 Adob​​e AIR 应用程序,它可以将文件上传到运行 Apache 和 PHP 的 Web 服务器。可以同时上传多个文件,并且应用程序还调用 Web 服务器以获取各种 API 请求。

我遇到的问题是,如果我开始两个文件上传,而它们正在进行中,任何其他 HTTP 请求都会超时,这会导致应用程序出现问题,并且从用户的角度来看。

Adobe AIR 应用程序是否仅限于 2 个 HTTP 连接,或者可能是其他问题?通过搜索这个问题,我没有发现太多,但一篇文章确实表明它不仅限于两个连接。

文件上传通过调用 File 类上传方法执行,API 调用使用 HTTPService 类完成。我正在使用的开发 Web 服务器是 WAMP 服务器,但是当应用程序发布时,它将与 LAMP 服务器通信。

谢谢,格兰特

这是我用来上传文件的代码:

以下是 API 调用的代码:

0 投票
0 回答
1778 浏览

xmpp - Multiple XMPP BOSH Connections Interfering in Internet Explorer - UPDATE: Seen In Other Browsers

Introduction

I am working on an MVC web app that is using XMPP for two purposes: 1) Communicating real time data from the server to the client - XMPPMessaging 2) User group chat - XMPPChat

I am using Strophe.js on the client side and MatriX C# library on the server side. XMPPChat is being set up by prebinding on the server side and passing the connection info to the client, which attaches with strophe. XMPPMessaging is not prebinding, just logging in on the client side. Every window that the user opens connects a new XMPPMessaging instance to receive data from the server. Only the chat windows connect XMPPChat and XMPPMessaging. Also, both are connecting to the Punjab connection manager over BOSH, which is forwarding the messages to an Openfire server.

Issue

Currently, I have an issue that only manifests itself in Internet Explorer (I am testing with IE8 and IE9 and both exibit this issue). When I have XMPPMessaging and XMPPChat connected, chat messages are being sent after a very large delay (10 sec - 2 minutes). I've seen this cause disconnection issues for XMPPChat as well. The receive functionality works great; if any other browser posts to the chatroom, IE get's it immediately just like everyone else. When XMPPMessaging is turned off, the chat send runs great with no delays or disconnections. I've stepped through the code with breakpoints and the send functionality is firing immediately. I've also observed the Punjab logs, and it appears that Punjab isn't getting the message till after the delay and is passing them along fine (also evidenced by the other browsers working fine).

I'm mostly wondering if anyone else has seen issues like this one with concurrent BOSH connections in IE comehow interfering.

Update

The chat feature in IE started working today completely inexplicably; I haven't changed the code or any configuration of it at all. I double checked that the messaging connection and chat connection were both running, and they both were connected. In attempts to diagnose the fix, I restarted Apache and the bug came back, again only in IE we saw the chat slow down significantly and randomly disconnect.

Update 2 - SEEN IN OTHER BROWSERS

Today I was able to recreate the issue in other browsers (Chrome, Firefox) by opening multiple chat instances in other tabs. So it seems that IE only suffered worse from the issue - only needing one tab open. This is pointing me towards a browser concurrent connection limit issue, but that doesn't make sense to be either considering that I shouldn't be anywhere near the limit with 2 connections.

Update 3 - CAUSE DETERMINED IN OTHER BROWSERS

I performed a test in Firefox to confirm my suspicions that we are dealing with a concurrent connection issue. I opened one chat tab and the messages posted instantaneously. I opened a second one and, as expected, they delayed. I then opened about:config and changed network.http.max-persistent-connections-per-server from 6 to 7. After doing this I repeated the test. I was able to post messages instantaneously in both the first and second chat tabs, but when I opened a third they all began experiencing the delay. I'm going to try and test in IE to see if this is the same problem by modifying the FEATURE_MAXCONNECTIONSPERSERVER registry settings and seeing if the problem goes away.

Update 4 - IE ISSUE STILL NOT RESOLVED

I performed the same test in IE, changing the registry as shown here, adding iexplorer.exe DWORD settings to the FEATURE_MAXCONNECTIONSPERSERVER and FEATURE_MAXCONNECTIONSPER1_0SERVER registries set to 0xA, but no changes in behavior are apparent. I tried the same thing with the x64 settings (under Wow6432Node) and still observed no changes. I also tried changing the original explorer.exe values from 2 or 4 to 8, but still saw no changes in behavior, all after restarting the computer after each change.

Code

For reference, here is some of my XMPP chat code which may or may not be relevant:

And here is some of my XMPP messaging code:

0 投票
2 回答
12346 浏览

http - 每个主机限制的 HTTP 同时连接数......是每个选项卡、浏览器实例还是全局?

根据 HTTP 规范 (w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.4),HTTP 客户端应该限制它们的连接:

使用持久连接的客户端应该限制他们维护到给定服务器的同时连接的数量。单用户客户端不应与任何服务器或代理保持超过 2 个连接。

不同的供应商以不同的方式实现此限制:http: //www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/

但。此限制适用于每个选项卡、每个浏览器实例还是全局适用于浏览器的所有实例?弹出窗口(对话框)是否被视为选项卡或独立选项卡的一部分?

对于 websockets,每个源的连接限制是否适用于每个选项卡、浏览器实例或全局?