socket.io的xhr-polling问题,网速太慢延迟致连接重连
发布于 11 年前 作者 arrowing 13322 次浏览 最后一次编辑是 8 年前

为什么我本地用xhr-polling方式传输数据没有问题 放到了空间上就各种蛋疼,websocket是没问题的

成功握手,就是取不到数据 握手响应:dPthxeIT4hOQqlzYklMV:60:60:xhr-polling,jsonp-polling

握手后的请求 http://host:8888/socket.io/1/xhr-polling/dPthxeIT4hOQqlzYklMV?t=1355038220437 OK 继续请求,发送事件信息 http://host:8888/socket.io/1/xhr-polling/dPthxeIT4hOQqlzYklMV?t=1355038220662 404 Not found

看了下socket.io-spec 我猜测是这个问题: If the connection is not resumed within the negotiated timeout the socket is considered disconnected. At this point the client might decide to reconnect the socket, which implies a new handshake.

就是传输过久没收到回应,就会重新建立一个连接

这个问题困扰我好几天了,求高手拯救

2 回复

我也遇到这个问题,客户端很久才收到数据,有时候根据就收不到,我想采取flashsocket协议,可是部署完了后,在本地测试没问题,在服务器上就IE就连不上了,切换协议有问题,真奇怪……还是解决中……

我用的是nginx + tcp module

最后确定可能是我们用到的F5负载均衡器的原因,排除nginx+ tcp module问题。

回到顶部