Answer the question
In order to leave comments, you need to log in
How to save data before disconnecting user (socket.io)?
When the user connects, I write different data to
and when the user disconnects, I need to write them to NeDB, but with the disconnect eventsocket.username = {"auth" : false ......};
socket.on('disconnect', function(){
});
Answer the question
In order to leave comments, you need to log in
After a disconnect, the socket object does not cease to exist, all data in it is preserved.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question