Photon not disconnecting if we disconnect internet while connected
Hi,
We are facing this issue with PUN. While game is running and if we disconnect internet, we don't get disconnect callbacks and game keeps running.
PUN + 1.73
Unity 5.4.2p2
Steps to reproduce
1. Connect your device or machine to a wifi
2. Once inside room, remove internet cable from your router or if you are using android device just pull down setting and switch off wifi.
Notice that app doesn't get disconnected. We have set background time out and app disconnect time out to 10seconds.
Thanks
We are facing this issue with PUN. While game is running and if we disconnect internet, we don't get disconnect callbacks and game keeps running.
PUN + 1.73
Unity 5.4.2p2
Steps to reproduce
1. Connect your device or machine to a wifi
2. Once inside room, remove internet cable from your router or if you are using android device just pull down setting and switch off wifi.
Notice that app doesn't get disconnected. We have set background time out and app disconnect time out to 10seconds.
Thanks
0
Comments
-
I have implemented a work around for this. I check LastSendAckTime of NetworkingPeer. If the difference is more than 15s then we disconnect
if(PhotonNetwork.connected) { if(m_LastPhotonACKTime != PhotonNetwork.networkingPeer.LastSendAckTime) { m_LastPhotonACKTime = PhotonNetwork.networkingPeer.LastSendAckTime; m_LastPhotonACKTimeReceived = PhotonNetwork.time; } else if(0d != m_LastPhotonACKTimeReceived && PhotonNetwork.time - m_LastPhotonACKTimeReceived > 15) { PhotonNetwork.Disconnect(); } }
1 -
@avinash I think PlayerTTL (Time to live) of RoomOptions when you create room, you need set PlayerTTL = 00
-
Hi,
very cool trick with LastSendAckTime, totally going to use that!
Bye,
Jean1 -
Hi, what is youravinash said:I have implemented a work around for this. I check LastSendAckTime of NetworkingPeer. If the difference is more than 15s then we disconnect
if(PhotonNetwork.connected) { if(m_LastPhotonACKTime != PhotonNetwork.networkingPeer.LastSendAckTime) { m_LastPhotonACKTime = PhotonNetwork.networkingPeer.LastSendAckTime; m_LastPhotonACKTimeReceived = PhotonNetwork.time; } else if(0d != m_LastPhotonACKTimeReceived && PhotonNetwork.time - m_LastPhotonACKTimeReceived > 15) { PhotonNetwork.Disconnect(); } }
m_LastPhotonACKTime
m_LastPhotonACKTimeReceived
0d
Are they variables?0 -
Yes, These are local variable. used in this code only.NomadicWarrior said:
Hi, what is your
m_LastPhotonACKTime
m_LastPhotonACKTimeReceived
0d
Are they variables?private int m_LastPhotonACKTime = 0; private double m_LastPhotonACKTimeReceived = 0d;
0