Node.js socket.io套接字在重新连接60秒后断开
在断开连接事件中,我使用socket.socket.reconnect()再次连接到套接字。插座工作正常,直到重新连接。重新连接后,我看到插座每60秒断开一次。 这是我的连接代码:Node.js socket.io套接字在重新连接60秒后断开,node.js,sockets,socket.io,Node.js,Sockets,Socket.io,在断开连接事件中,我使用socket.socket.reconnect()再次连接到套接字。插座工作正常,直到重新连接。重新连接后,我看到插座每60秒断开一次。 这是我的连接代码: socket = io.connect("https://website.com:8080", {'close timeout':'3', 'force new connection':true}); 以下是我在断开连接时所做的: socket.on('disconnect', function () { ale
socket = io.connect("https://website.com:8080",
{'close timeout':'3',
'force new connection':true});
以下是我在断开连接时所做的:
socket.on('disconnect', function () {
alert("disconnect");
socket.socket.reconnect();
});
现在,如果我在客户端启动一个socket.disconnect(),该套接字将每隔60秒保持断开和重新连接。
我做错了什么?找到了解决方案?我对PeerJS-server的底层套接字连接也有同样的问题,而我的socket.io连接或多或少保持稳定。