OnDisconnectedFromPhoton not called

Hi, I am having a strange issue where OnDisconnectedFromPhoton is not called. I just disable the WIFI. After around 1 min it throws socket exception but nothing is called. Sorry it is not throwed but printed

Comments

  • Eduard
    Eduard
    edited October 2017
    Edit:OnConnectionFail is called after timeout but OnDisconnectedFromPhoton is not called. In documentation it says that after OnConnectionFail also OnDisconnectedFromPhoton is called. Is this a bug?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Eduard,

    Thank you for choosing Photon!

    I could not reproduce this using both TCP and UDP on Photon Cloud.
    Latest PUN (1.86.1) and Unity 5.0.4f1 on Windows 10 64bits.

    After disabling WiFI both OnConnectionFail and OnDisconnectedFromPhoton are called.
  • I am using the latest version from assets store. I have tried on mac with Unity5.5. OnDisconnectedFromPhoton is not called at all. Region is EU
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited October 2017
    Could you post code snippet or share small repro project?
    With steps to reproduce of course.

    After around 1 min it throws socket exception
    Are you sure it's one minute?
    it throws socket exception
    Could you post the SocketException message?
  • O sorry for that "After around 1 min it throws socket exception". That was in first post before I updated to latest version. In latest version OnConnectionFail is called correctly but OndisconnectedFromPhoton is not called. As regarding the code is like one in photon guides. Inheriting from PunBehaviour and overriding methods
  • JohnTube
    JohnTube ✭✭✭✭✭
    On Windows, from Unity Editor version 5.0.4f1, using default TCP settings, after I disable WiFi, I get
    Receiving failed. SocketException: TimedOut

    after timeout which is 10 seconds and both expected callbacks are called; OnConnectionFail and OnDisconnectedFromPhoton.

    what is the "Socket Exception message" you get? "TimedOut" or "ConnectionAborted" (like here)?

    I have tried on mac with Unity5.5
    Editor or build?
  • Eduard
    Eduard
    edited October 2017
    I just tested today and it worked. Both callback are called. This is strange because nothing has changed.
    Thank you very much for your support. I really appreciate it.
  • Eduard
    Eduard
    edited April 2018
    Sorry for waking up this thread. Same thing is happening, there is a delay in editor before OnPhotonDisconnected is called. Latest version of photon is used
  • Eduard
    Eduard
    edited May 2018
    Definitely this callback doesn't fire immediately. This is critical for my scenario. So I cannot wait for timeout. I will search for other methods.
  • public override void OnDisconnected(DisconnectCause cause)
    {
    base.OnDisconnected(cause);
    ** do whatever you need here **
    }