سؤال

I need to offload connections from the node server to redis, so I could update (and restart) the node server on a live system. Then pull the connections back from redis into node. Is this possible with SockJS connections?

هل كانت مفيدة؟

المحلول 2

If you restart your node server all your connections will be lost and your clients will be disconnected, there is no way to store the connections to reboot a server.

نصائح أخرى

I have a suggestion (don't know if it still on time):

There is no way you can store networking connection on wherever (it not serializable in any way, since it is based on OS resources). But you can store on Redis (or any other storage mechanism) all relevant user session state, indexed by an user id of any kind.

In order to recover from a server reboot (or crash), the client could reconnect and given that it knows the user id, it can be reattached to the session state.

If you have any kind of fail over mechanism, or if the reboot process is short enough, your users will feel nothing but a little freezing on communication, if any.

I hope this can help.

Regards.

Heleno

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top