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:
- disable, enable wifi on peer a
peer can send messages b, b doesn't receive them.
press home button
this causes
onstop(),leaveroom()called.peer b receives
onpeerleft(),onpeersdisconnected()callbacks.
it looks peers re-connected after wifi re-enabled.
Comments
Post a Comment