简体   繁体   English

Websocket问题Internet Explorer

[英]Websocket issue Internet Explorer

My app collects news and is fed by a websocket that periodically provides the data to show, the cadence of news is changeable and depends on when the vendors emit them. 我的应用程序收集新闻并由网络套接字提供,该网络套接字定期提供要显示的数据,新闻的节奏是可变的,并取决于供应商何时发布它们。 When the app is opened in Internet Explorer, if no new items are received, the connection is stopped suddenly after about 20 seconds. 在Internet Explorer中打开该应用程序时,如果未收到新项目,则大约20秒后,连接会突然停止。

By doing some research I managed to bring the problem back to this specific Internet Explorer behavior: 通过做一些研究,我设法将问题归结为这种特定的Internet Explorer行为:

https://connect.microsoft.com/IE/feedback/details/804653/rfc6455-websocket-pong-frame https://connect.microsoft.com/IE/feedback/details/804653/rfc6455-websocket-pong-frame

In practice I found that IE sends Pong control frames, but if it does not receive a Ping response, it closes the connection. 在实践中,我发现IE发送Pong控制帧,但如果未收到Ping响应,则会关闭连接。 Unfortunately I can not change anything server side to handle this unsolicited message, I was wondering if there is a way to handle this abnormal IE behavior from inside my app. 不幸的是,我无法更改任何服务器端来处理此未经请求的消息,我想知道是否有办法从我的应用程序内部处理此异常IE行为。

It seems that the issue happend only if the webSocket remain in idle state for more than 20 secs. 似乎只有在webSocket保持闲置状态超过20秒时,才会发生此问题。 We simply raised the frequency of heartbeat messages from the server up to 1 message every 10 secs and the issue never happened again 我们只是将来自服务器的心跳消息的频率提高到每10秒1条消息,而问题再也没有发生

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

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