Socket.io creates duplicate connections whenever the server restarts #5203
Unanswered
nitinankad
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I have a socket.io server and client for a chat room application and I'm running into an issue where the client connections are being duplicated whenever the server restarts. I'm storing users into a database for the chat room so that I can get active members and it's leaving behind stale records as a result of the server restart. I'm currently thinking of having an event listener for
SIGINT
andSIGTERM
and cleaning up the stale records that way. Do I need to do anything special to clean up the previous connections?All the code for both frontend and backend can be found here: https://github.com/octree-io
Beta Was this translation helpful? Give feedback.
All reactions