Does anyone know what events are built-in in Socket.io?
For example: connection
, disconnect
, join
etc.
Acknowledgements In Socket.IO, this feature is named acknowledgements. You can add a callback as the last argument of the emit() , and this callback will be called once the other side acknowledges the event: io. on("connection", (socket) => { socket.
socket.io rooms are a lightweight data structure. They are simply an array of connections that are associated with that room. You can have as many as you want (within normal memory usage limits). There is no heavyweight thing that makes a room expensive in terms of resources.
You can check the socket. connected property: var socket = io. connect(); console.
Here is all I found in the official docs:
socket.io
object:connect
. Fired upon a successful connection.connect_error
. Fired upon a connection error.Object
error objectconnect_timeout
. Fired upon a connection timeout.reconnect
. Fired upon a successful reconnection.Number
reconnection attempt numberreconnect_attempt
. Fired upon an attempt to reconnect.reconnecting
. Fired upon an attempt to reconnect.Number
reconnection attempt numberreconnect_error
. Fired upon a reconnection attempt error.Object
error objectreconnect_failed
. Fired when couldn’t reconnect within reconnectionAttempts
socket
object:connect
. Fired upon connecting.error
. Fired upon a connection errorObject
error datadisconnect
. Fired upon a disconnection.reconnect
. Fired upon a successful reconnection.Number
reconnection attempt numberreconnect_attempt
. Fired upon an attempt to reconnect.reconnecting
. Fired upon an attempt to reconnect.Number
reconnection attempt numberreconnect_error
. Fired upon a reconnection attempt error.Object
error objectreconnect_failed
. Fired when couldn’t reconnect within reconnectionAttempts
connection
/ connect
. Fired upon a connection.Socket
the incoming socket.For the current version (1.3.4
) the reconnect_attempt
and reconnecting
client-side events are synonyms.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With