Socket.io architecture/configuration to connect to the closest server (GA) when it becomes available after the client has connected

0

We have Global Accelerator setup in Amazon to route requests to the closest node (EC2) from some multiple nodes.

How does socket.io play out in this case? If let's say a user connected, and the socket client is connected to host A, but then host B which is closer, becomes available, is there some way for the socket requests to be routed through this closest server?

The typical scenario would be that if for some reason host B is overloaded and the Accelerator just routes the socket client to use host A at the time, but now the user is stuck on the distant server until he refreshes his page.

Thanks

1개 답변
0

Hello!

Unfortunately, this is a socket.io issue rather than an AWS one. Socket.io is a specific TCP connection between a client and a server. To switch hosts with socket.io you must disconnect from host A and reconnect to host B.

Any traffic routed without reconnecting will always go through host A until you disconnect and connect to another host.

I would suggest looking for a different architecture if you desire this functionality.

Hope this helps!

Mark_G
답변함 9달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠