Graceful shutdown disconnect clients & reconnection #4083
Replies: 2 comments 1 reply
-
It's been quite some time, but anyone has any idea how to solve this issue? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
That sounds weird, the So the clients should not be able to reconnect directly. Could you please check? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm trying to implement a graceful shutdown in my project. I have the following setup:
This works fine and it disconnects every client and gracefully shuts down the socket. Don't know if it's ideal, but it works. Only executing the
close()
function will close every connection but they reconnect again and the function will never perform a callback.Only problem with this is that the clients will never try to reconnect after that, even with the
forceNew: true
option.With multiple instances of the software, the clients should try to reconnect again so it'll reconnect with another instance. Now, it just stops connecting after one server went down.
I can probably handle this case in the client, but I believe this should be done by the
socket.io-client
package automatically.Any suggestions?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions