socket.io transport 'flashsocket' takes 5 seconds to start on IE 8

别等时光非礼了梦想. 提交于 2019-12-23 04:03:12

问题


This is running against localhost, with all other transports disabled for testing.

When testing other transports on IE and other browsers, there's no such lag.

Anything that can be done about this? I've got the latest Adobe Flash installed, running Windows 7 64bit, socket.io 0.9.


回答1:


The problem is with how Flash policy server is working: it tries to connect to port 843 at first and obtain policy file. If there is no response within 5 seconds it tries to obtain policy file from server - and socket.io is providing this file internally. If you want to prevent such situation you can run your own flash policy server from link above - this will take you couple minutes and improve user experience significantly.




回答2:


I think the problem is that IE 8 does not support websocket, which falls back to long polling when you try to use flashsocket. Even IE 9 does not natively support sockets. You can use IE 10 provides which native support, but it is disabled by default. Look here for which browsers support websockets

The five second wait that you are experiencing is because of the long-polling. The server holds the request until timeout or some info arrives. See the differences here socket.io - XHR polling vs flashsocket and websocket



来源:https://stackoverflow.com/questions/11423797/socket-io-transport-flashsocket-takes-5-seconds-to-start-on-ie-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!