If a client socket disconnected during the middle of a multiplayer game. Does socket.io queue events that are emitted by the server after the has client disconnected?
If so this would mean that when the client socket reconnected, it would be updated with all the events which the server tried to emit to if while it was disconnected.
No, you would need some sort of data structure on the server-side that holds a record of whatever data the client needs, then be able to update the client if they connect again. When a user disconnects from Socket.io then connects again, the socket ID is never the same, so you need some sort of unique identifier that can let the server know which client is who (i.e. username, userID, etc)
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