You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Socket.io中pingTimeout与pingInterval的默认值确认

关于Socket.io中pingTimeout和pingInterval默认值的确认

没错,你查到的这两个数值完全正确,就是Socket.io中这两个参数的默认值:

  • pingTimeout 默认值为 60000 毫秒(即60秒):当服务端在这段时间内没有收到客户端返回的pong数据包时,就会判定连接已关闭。
  • pingInterval 默认值为 25000 毫秒(即25秒):服务端会每隔这个时长向客户端发送一次ping数据包,以此来校验连接是否仍处于可用状态。

你在文档中看到的这段描述是官方给出的准确说明:

pingTimeout (Number): how many ms without a pong packet to consider the connection closed (60000)
pingInterval (Number): how many ms before sending a new ping packet (25000).

内容的提问来源于stack exchange,提问作者roh_dev

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 06:39:14