You’re writing a web UI that uses web sockets to communicate with the server. The websocket you’re connected to is designed to force shutdown after receiving a certain RPC. But then a new websocket on the same port and IP pops up that you need to connect to. This new web socket does not have the same methods for RPC as the previous one.

How do you ensure a smooth transition on the UI side of things?

Reply to this note

Please Login to reply.

Discussion

👀

I would recommend using either separate ports or separate RPC gateway paths, or, just never closing the socket but instead making the RPC interface methods stateful, creating a method to check the state, and an error code to correspond to a method called on the wrong state.