XMLHttpRequest:Internet Explorer 9 中一毫秒内的双 TCP SYN
当我尝试发送一些 POST 数据时,XMLHttpRequest 对象会导致两个 TCP SYN 数据包。 这发生在不到一毫秒的时间内。 我无法在任何其他浏览器中重现此行为(使用最新的 Firefox 和 Google Chrome 浏览器进行测试)。
即使“异步”标志或超时设置似乎也没有改变这种情况。
问题是,当 IE9 发送两个 SYN 时,服务器的 TCP/IP 堆栈将自动确认它们。但不幸的是,IE9 随后在第二个流中发送 Post 数据,这意味着 Web 服务器已经在第一个套接字上等待字节(导致超时)。 发生这种情况是因为我们正在讨论一台可以同时处理一个套接字的单线程 Web 服务器。
有什么建议或想法吗?
我想阻止 IE9 同时建立两个套接字。
无论我使用 Jquery ajax 函数还是自己在 java 脚本中实现它,都会发生这种情况。
最好的问候
马蒂亚斯
the XMLHttpRequest object causes two TCP SYN Packets when I try to send some POST data.
This happens in less than a millisecond.
I cannot reproduce this behavior in any other browser (tested with the latest Firefox and Google Chrome browser).
Even the 'asynch' Flag or timeout setting does not seem to change the situation.
The Problem is that when IE9 sends two SYN, they will be automatically ackowledged by the Server's TCP/IP Stack. But unfortunately IE9 then sends the Post data in the second stream, which means that the web server is already waiting for bytes on the first socket (causes a timeout).
This happens because we are talking about a single threaded web server that can handle one socket at once.
Any suggestions or ideas?
I would like to prevent IE9 from establishing two sockets at once.
This happens no matter if I use the Jquery ajax function or implement it by myself in java script.
Best Regards
Matthias
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只是一个想法,您可以尝试在所有服务器响应中添加
Connection: close
标头,以确保浏览器为每个请求启动新的 tcp 连接。Just an idea, you could try adding a
Connection: close
header in all server responses to make sure the browser is starting a new tcp connection for every request.我们通过wireshark注意到同样的事情,IE9自己的F12调试器显示一个POST,但是从客户端IE9机器发出的数据包显示两个POSTS...并且服务器也收到2个POSTS,这会导致我们的应用程序在客户端上出现不一致的问题服务器端。
版本 9.0.8112.16421,更新版本 9.0.3 (KB 2586448)
我们必须启用 IE8 兼容性标头才能阻止双帖子
这很奇怪……并不是我们所有的表单都会发生这种情况,就像 JS 编译器就如何在不同的上下文中执行代码得出某些结论一样。
很高兴了解客户端关闭的标头...从长远来看,这可能对我们更好...希望它能在 IE9 中得到解决
We are noticing the same thing via wireshark, IE9's own F12 debugger shows a single POST, but the packets coming out of the client IE9 machine shows two POSTS... and the server receives 2 as well which causes inconsistent problems for our app on the server side.
Version 9.0.8112.16421, update versions 9.0.3 (KB 2586448)
We had to enable the IE8 compatibility header to stop the double posts
<meta http-equiv="X-UA-Compatible" content="IE=8" /
>It's very odd... doesn't happen with all our forms, almost like the JS compiler is coming to certain conclusions about how to execute the code in different contexts.
Good to know about the header close on the client side... that might be better for us long term... hopefully it will be resolved in IE9