I am using cluster module to fork a new worker every time a worker process dies. My node server and client communicate over websockets (socket.io). What I see is that after a worker dies and the client connects to a new worker process, the communication occasionally falls back to xhr-polling.
So before a worker dies: websockets.
After a worker dies: xhr-polling (sometimes. But why ?. I do a see handshake errors upon reconnect when this happens)
I have configured the transport option to use 'websocket' only, but this does not seem to help.
I also tried configuring the parameters mentioned below, as suggested here. But this did not help either. I still see occasional fallback to xhr-polling after a reconnect to a new worker.
- tryTransportsOnConnectTimeout - default value is true
- rememberTransport - default value is true
Any idea how I can force the use websockets only ?
Thanks in advance.