google play games - Android Realtime Multiplayer (GPGS) - disconnect not detected? -


i have realtime 2-player game based on buttonclicker sample. when turn off wifi on 1 of connected peers, peer receives callback onp2pconnected(). other player doesn't receive callback @ all.

also, code

for (participant p:mparticipants) {     log.v(tag, p.getdisplayname()+" status "+p.getstatus());             } 

prints status == 2 (status_joined) on both clients after loss of connectivity.

how can detect disconnects?

is possible reconnect client? (sometimes connection lost few seconds).

edit here experiment:

  1. disable, enable wifi on peer a
  2. peer can send messages b, b doesn't receive them.

  3. press home button

  4. this causes onstop() , leaveroom() called.

  5. peer b receives onpeerleft() , onpeersdisconnected() callbacks.

it looks peers re-connected after wifi re-enabled.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -