cancel
Showing results for 
Search instead for 
Did you mean: 

P2P how to handle internet loss

jibbs63
Level 4

Hi,

 

I have my game setup (using UNITY) and running on PC ( and Quest ). My question is how do people usually handle when one player has their internet go out while in a match?

 

My game specifically only ever has 2 players, so if one players internet goes out I would expect the other player to be aware of that somehow and respond accordingly. I don't see the player getting any kind of event or notification or anything like that. Do I need to add a heartbeat that constantly pings the opponent and use that to determine the other player's internet went out? That seems like it would be build into the SDK, but perhaps not.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

jibbs63
Level 4

Update for anyone seeing this. Apparently it is built into the SDK and both instances get the p2p disconnected event after about 10 seconds of no internet. I was previously testing it using two instances on the same computer and then blocking network traffic to one using my firewall. For some reason, that did not cause the disconnected event, even though I could not communicate between instances. I realized I was still able to ping the blocked instance though.

 

However, I tried using two different machines and I got the disconnection events as expected.

View solution in original post

1 REPLY 1

jibbs63
Level 4

Update for anyone seeing this. Apparently it is built into the SDK and both instances get the p2p disconnected event after about 10 seconds of no internet. I was previously testing it using two instances on the same computer and then blocking network traffic to one using my firewall. For some reason, that did not cause the disconnected event, even though I could not communicate between instances. I realized I was still able to ping the blocked instance though.

 

However, I tried using two different machines and I got the disconnection events as expected.