Forum General Rare occurrences of lost messages

Any issues or discussions relating to Unity development are welcome here.

Rare occurrences of lost messages

Postby Stamperino » July 15th, 2019, 3:08 am

Hi, over the past month I've been learning client/server dev, and chose pio to start.

I've built my game in Unity WebGL, and got it all working in browser on itch.io.

Rarely a message will fail to broadcast. It has happened a few too many times, and i'm worried about the integrity of my server's order of events, which would be really bad if more important events didn't sync.

To my understanding Tcp shouldn't have lost messages, so this has to be some kind of connection stability issue.

Regardless of the cause, what can I do to handle this?
Stamperino
 
Posts: 4
Joined: May 22nd, 2019, 7:36 pm

Re: Rare occurrences of lost messages

Postby robscherer123 » July 15th, 2019, 3:02 pm

Hmm, I can't say I've ever really had this happen, or at least that I know of.

Just to be completely sure, there's nothing else in your code that would make it seem like the message failed or prevent it from being sent, right? Are you aware if the player is getting disconnected and then reconnected? Is the message perhaps, just taking an oddly very long time to be sent/received?
robscherer123
Paid Member
 
Posts: 309
Joined: December 12th, 2012, 8:46 pm

Re: Rare occurrences of lost messages

Postby Stamperino » July 16th, 2019, 3:01 am

robscherer123 wrote:Just to be completely sure, there's nothing else in your code that would make it seem like the message failed or prevent it from being sent, right?


Right

In a timer I loop through my map data array, and broadcast the tile id for players to sync. Nothing different between broadcasts, except the rare time a random tile doesn't show up.

robscherer123 wrote:Are you aware if the player is getting disconnected and then reconnected? Is the message perhaps, just taking an oddly very long time to be sent/received?


I don't know if the player is getting disconnected then reconnected, since all players don't receive the message, and the message does get sent, it just never arrives.
Stamperino
 
Posts: 4
Joined: May 22nd, 2019, 7:36 pm

Re: Rare occurrences of lost messages

Postby robscherer123 » July 16th, 2019, 2:42 pm

Hmm, yea that's odd, I'm not sure that I've ever noticeably had that happen so I'm not sure I can be of much help. I would think if they were getting disconnected though, you would know.
robscherer123
Paid Member
 
Posts: 309
Joined: December 12th, 2012, 8:46 pm

Re: Rare occurrences of lost messages

Postby Stamperino » July 20th, 2019, 7:27 am

I figured that would be the case, if there wasn't any other solid reason, thanks.
Stamperino
 
Posts: 4
Joined: May 22nd, 2019, 7:36 pm

Re: Rare occurrences of lost messages

Postby nobodyHere » July 24th, 2019, 10:55 pm

Are you sure it's the messages being lost?
Have you tried checking the devtools from Chrome for example to inspect the websocket traffic?
nobodyHere
 
Posts: 20
Joined: April 30th, 2012, 8:52 pm

Re: Rare occurrences of lost messages

Postby Stamperino » July 25th, 2019, 3:25 am

Thanks, i didn't know chrome had a websocket log, I'll check the next time it occurs since I made some changes to reduce necessary messages.
Stamperino
 
Posts: 4
Joined: May 22nd, 2019, 7:36 pm


Return to General