Socket.io的默认事件列表

服务端事件

事件名称 事件解释
connection socket连接成功之后触发,用于初始化
message 客户端通过socket.send来传送消息时触发此事件
anything 收到任何事件时触发
disconnect socket失去连接时触发

客户端事件

事件名称 事件解释
connect 连接成功
connecting 正在连接
disconnect 断开连接
connect_failed 连接失败
error 错误发生,并且无法被其他事件类型所处理
message 同服务器端message事件
anything 同服务器端anything事件
reconnect_failed 重连失败
reconnect 成功重连
reconnecting 正在重连

相关文章:

  • 2021-10-30
  • 2022-02-16
  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2021-05-19
猜你喜欢
  • 2022-01-17
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案