我在使用sails.js和socket.io时遇到了麻烦。 在没有使用网站的一段时间后,套接字断开连接。
我收到了经典错误:
La connexion avec ws://localhost:1337/socket.io/?__sails_io_sdk_version=0.11.0&__sails_io_sdk_platform=browser&__sails_io_sdk_language=javascript&EIO=3&transport=websocket&sid=XfNvq0iSTWIg564BAAAB a été interrompue pendant le chargement de la page.
sails.io.js (ligne 5)
====================================
sails.io.js (ligne 141)
Socket was disconnected from Sails.
sails.io.js (ligne 141)
Usually, this is due to one of the following reasons:
-> the server was taken down
-> your browser lost internet connectivity
sails.io.js (ligne 141)
====================================
sails.io.js (ligne 141)
Socket is trying to reconnect to Sails...
_-|>_- (attempt #1)
sails.io.js (ligne 141)
GET http://localhost:1337/socket.io/?__sails_io_sdk_v...script&EIO=3&transport=polling&t=1431665759996-3
200 OK
1ms
sails.io.js (ligne 4)
|> Socket reconnected successfully after
\___/ being offline for ~1.017 seconds.
sails.io.js (ligne 141)
GET http://localhost:1337/socket.io/?__sails_io_sdk_v...lling&t=1431665760011-4&sid=0_H09meFWxjaSLRPAAAC
200 OK
0ms
sails.io.js (ligne 4)
|> Now connected to Sails.
\___/ For help, see: http://bit.ly/1DmTvgK
(using browser SDK @v0.11.0)
Sails表示已成功连接,但如果我尝试刷新或其他任何东西再次断开连接......我必须再次抬起以正确连接。
有人知道该怎么做,或者是什么导致这类问题?