Unity Socket io stop emitting the data for some seconds after working well for 45-50 seconds

95 views Asked by At

I am using socket io third-party package https://github.com/itisnajim/SocketIOUnity for my multi-player game.

While developing I am facing one issue in gameplay. My game runs well and emits all the data and other players receive all the passing data for 45-50 seconds, the app stops/pauses for 5-10 seconds and then starts working again. During those 5-10 seconds whatever gameplay is going user is not able to pass the data to the server. As we have checked in the server also that server is not receiving any call from a client so that it can provide response.

While checking the server we noticed that whatever socket call the player was making for that 5-10 second durations all the calls received at the same time to the server. so ultimately those 5-10 second durations are causing problems to the gameplay.

Can anyone here suggest what may be the problem that makes socket pause, and not working as expected??

I have tried playing the game on Android devices as well as in the editor and noticed that the socket emits the data but the server does not receive those data during those 5-10 seconds apart from that duration socket works well, passing and receiving data to those two-player who are playing the game is working well. also want to add here that the data passed to the server during those 5-10 seconds reaches the server at the same time in one hit, after that duration (paused/stopped 5-10 seconds)

Server log

Here in the server log you can see the last four logs response at the same time which should not be the case, it happens as server received that call request at same time and from the unity socket event has been called one by one as you can see above log.

0

There are 0 answers