Socket.io事件列表

有谁知道在Socket.io中内置了什么事件
例如: connectiondisconnectjoin

以下是我在官方文档中find的所有内容:

socket.io对象的客户端事件:

  • connect 。 在成功的连接上被解雇。
  • connect_error 。 遇到连接错误。
    参数:
    • Object错误对象
  • connect_timeout 。 在连接超时后触发。
  • reconnect 。 在成功的重新连接之后被解雇。
    参数:
    • Number重新连接尝试号码
  • reconnect_attempt 。 试图重新连接时被解雇。
  • reconnecting 。 试图重新连接时被解雇。
    参数:
    • Number重新连接尝试号码
  • reconnect_error 。 在重新连接尝试错误时触发。
    参数:
    • Object错误对象
  • reconnect_failed 。 在reconnectionAttempts尝试中无法重新reconnectionAttempts时触发

socket对象的客户端事件:

  • connect 。 连接时发射。
  • error 。 遇到连接错误
    参数:
    • Object错误数据
  • disconnect 。 在断开连接时触发。
  • reconnect 。 在成功的重新连接之后被解雇。
    参数:
    • Number重新连接尝试号码
  • reconnect_attempt 。 试图重新连接时被解雇。
  • reconnecting 。 试图重新连接时被解雇。
    参数:
    • Number重新连接尝试号码
  • reconnect_error 。 在重新连接尝试错误时触发。
    参数:
    • Object错误对象
  • reconnect_failed 。 在reconnectionAttempts尝试中无法重新reconnectionAttempts时触发

服务器端事件:

  • connection / connect 。 在连接上被解雇。
    参数:
    • 插入传入的套接字。

编辑:

对于当前版本( 1.3.4 ), reconnect_attemptreconnecting客户端事件是同义词。