Websocket在1分钟后关闭 [英] Websocket is closed after 1 min

查看:925
本文介绍了Websocket在1分钟后关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理聊天应用程序(使用rocket.chat)



这个我的网络套接字在1分钟后关闭,如果我什么都不做的话。



我的尝试:



i没有任何解决方案。

让我知道是否有人!

解决方案

Web套接字的空闲超时为60秒:如果你不使用通过ping和pong框架的心跳或类似,然后套接字假定用户已关闭页面并关闭套接字以节省资源。



理论上,你可以得到圆形这可以通过禁用超时来实现,但是本地规则可能会阻止它,无论如何都是一个非常糟糕的主意。

使用它来保持套接字存活,或者在需要时打开并关闭它。 / BLOCKQUOTE>

i am working on chat application (using rocket.chat)

in this my web socket is closed after 1 minute if i not do anything.

What I have tried:

i not got any solution.
give me any idea if any one have !

解决方案

Web Sockets have an idle timeout of 60 seconds: if you do not use a heartbeat or similar via ping and pong frames then the socket assumes that the user has closed the page and closes the socket to save resources.

In theory, you can get round this by disabling the timeout, but that may be prevented by local rules and is a very bad idea anyway.
Either keep the socket alive by using it, or open and close it when you need it.


这篇关于Websocket在1分钟后关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆