admin管理员组文章数量:1401484
I have two clients connected through WebSocket server that is behind my influence field. After about 1,5 minutes both clientes get disconnected. Reconnecting is not the best solution in my case, because it takes time and sometimes it occures that there should be send a message withing this time. Is this a kind of a server side configuration to maintain munication instantly? Is there a way to keep connection established doing something on the client side?
I have two clients connected through WebSocket server that is behind my influence field. After about 1,5 minutes both clientes get disconnected. Reconnecting is not the best solution in my case, because it takes time and sometimes it occures that there should be send a message withing this time. Is this a kind of a server side configuration to maintain munication instantly? Is there a way to keep connection established doing something on the client side?
Share Improve this question asked Feb 26, 2019 at 9:15 krzyhubkrzyhub 6,55011 gold badges44 silver badges70 bronze badges 5- How do they disconnect? Is it a build in timeout in the socket? Does it somehow crash after 90 seconds? – Emil S. Jørgensen Commented Feb 26, 2019 at 9:19
- Possible duplicate: stackoverflow./questions/4852702/… – Mebin Joe Commented Feb 26, 2019 at 9:19
- In my Node script I see 1006 code when disconnected. – krzyhub Commented Feb 26, 2019 at 9:29
- Backend is written in which language? – sarath Commented Feb 26, 2019 at 12:39
- @sarath Symphony 2.8.6 gos:websocket:server – krzyhub Commented Feb 26, 2019 at 13:11
1 Answer
Reset to default 6The Websocket protocol implements so called PING/PONG messages to keep Websockets alive, even behind proxies, firewalls and load-balancers. The server sends a PING message to the client through the Websocket, which then replies with PONG. If the client does not reply, the server closes the connection.
Check Your server config probably a wrong config have this side effect.
本文标签: javascriptWebSockethow to keep connectionStack Overflow
版权声明:本文标题:javascript - WebSocket - how to keep connection? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744295369a2599316.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论