What is the list of Socket.io events?

In this article, we’ll look at the list of Socket.io events.

The list of client side events for socket.io object includes:

  • connect – Fired upon a successful connection.

  • connect_error – Fired upon a connection error. Parameters: Object error object

  • connect_timeout – Fired upon a connection timeout.

  • reconnect. Fired upon a successful reconnection. Parameters: Number – reconnection attempt number

  • reconnect_attempt – Fired upon an attempt to reconnect.

  • reconnecting – Fired upon an attempt to reconnect. Parameters: Number – reconnection attempt number

  • reconnect_error – Fired upon a reconnection attempt error. Parameters: Object error object

  • reconnect_failed – Fired when couldn’t reconnect within reconnectionAttempts

The list of client-side events for socket object includes:

  • connect – Fired upon connecting.
    error. Fired upon a connection error Parameters: Object – error data

  • disconnect – Fired upon a disconnection.

  • reconnect – Fired upon a successful reconnection. Parameters: Number – reconnection attempt number

  • reconnect_attempt – Fired upon an attempt to reconnect.
    reconnecting. Fired upon an attempt to reconnect. Parameters: Number – reconnection attempt number

  • reconnect_error – Fired upon a reconnection attempt error. Parameters: Object – error object

  • reconnect_failed – Fired when couldn’t reconnect within reconnectionAttempts

The list of server-side events includes:

connection / connect – Fired upon a connection. Parameters: Socket

  • the incoming socket.