- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
当我读到 websockets 时,通常会提到心跳是必须具备的。 MDN 甚至写了一个 special opcode for heartbeats .
但是心跳是 websockets 的强制性部分吗?我是否必须实现它,否则我的 websockets 将被浏览器或其他一些标准终止?
最佳答案
RFC 6455 ,WebSocket 协议(protocol)的当前引用,定义了一些控制帧来传达有关 WebSocket 的状态:
0x8
0x9
0xA
Ping 和 Pong 用于心跳 并允许您检查客户端是否仍然响应。查看quote下面:
A Ping frame may serve either as a keepalive or as a means toverify that the remote endpoint is still responsive.
但是当客户端得到一个 Ping 时,必须将一个 Pong 发送回服务器。查看quote :
Upon receipt of a Ping frame, an endpoint MUST send a Pong frame inresponse, unless it already received a Close frame. It SHOULDrespond with Pong frame as soon as is practical.
在设计客户端和服务器时,是否支持心跳取决于您。但是如果您需要检查连接是否仍然存在,Ping 和 Pong 帧是执行此操作的标准方法。
请记住,如果发送了 Ping 而未发回 Pong,则一个点可能会认为另一个点不再存在。
关于http - websockets 必须有心跳吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46111656/
我正在使用血氧仪开展项目。我想对其进行平滑处理,以便可以使用它来计算心跳。我正在从麦克风收集原始数据,我将它们放在新数组中,比方说,sData[]。 信号真的很疯狂,如预期的那样在整个图上跳跃,所以我
如果您错过了 - TLS Heartbeat Extension 实现中的 OpenSSL 漏洞一直在流传。欲了解更多信息,请参阅http://heartbleed.com/ . 可能的缓解步骤之一是
随着关于 heartbleed 错误的讨论不断,很难找到关于 OpenSSL 的被利用的心跳扩展究竟用于什么的信息。 此外,是否可以针对 Apache w/mod_ssl 禁用它,而无需按照建议@ h
我是 Linux 新手,正在学习 LINUX heartbeat。我正在尝试做“yum install heartbeat”,如下所示…… # cat /etc/issueRed Hat Enterp
我在我们的服务器中使用带有kibana的heartbeat,metricbeat和elasticsearch 7.5,以检查服务器状态并检查应用程序的可用性。如果应用程序或服务器已关闭或没有响应,我想
我们有一个用 Java 编写的 RMI 客户端应用程序,它需要定期向服务器应用程序发送“保持 Activity ”消息。我们将其实现为一个单独的心跳线程,它向服务器发送保持 Activity 消息,然
我不确定如何最好地让我们的服务器知道我们的 iPhone 应用程序当前正在运行(即使在后台)。有几种不同的选择,但对于 Apple 批准程序允许的以及最可靠的选项存在一些担忧。如果考虑到 Apple
我似乎找不到关于如何在 Spring 中使用 websockets 向客户端发送心跳的好资源! 我有一个使用此配置运行的基本服务器: @Configuration @EnableWebSocketMe
我正在实现一个用于分布式 cronjob 执行的系统(所谓的 cron 计算集群)。当行动时间到来时,Cronjobs 应该排队进入消息队列(RabbitMQ)。在另一侧(集群的节点/ worker
使用 python kafka api 从主题中读取只有少量消息的消息。 Kafka 不断重复播放队列中的消息。 它从我的主题接收到一条消息(返回每条消息内容),然后抛出.更多日志: kafka.co
我目前有一个异步 TCP/IP 套接字 C# WinForms 应用程序,它是“服务器”应用程序。该应用程序持有客户端的持久套接字。我想实现一个心跳包来检测半开连接。 最初我只想创建一个循环并每隔 x
socket.io documentation提到可以像这样禁用心跳: io.disable('heartbeats'); 不幸的是,虽然这似乎阻止了心跳的发送,但客户端在不发送心跳时仍会断开连接。
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 Improve thi
我是一名优秀的程序员,十分优秀!