Users do not disconnect

Options
vitorcmaia
edited August 2012 in Photon Server
Hello,

I've made a stress test for my application, in which I connect 90 Photonpeers at once, and then disconnect them. I run this test continuously, connecting and disconnecting them, in loop. My licence permits a maximum of 100 users, so it should be fine.
But the test works only in the first loop, and sometimes in the second. From the third time on, I'm told that some users have disconnected by server user limit.
For every disconnection, I print the status in the console, and it assures that all 90 users have entered a Disconnect status in the end. So, why are some of these users keeping connected after I finish a single loop? I wonder if it is a common problem.

Thanks in advance.

Comments

  • Philip
    Options
    Hi Victor,

    no it shouldn't be - what version of Photon are you using? What protocol are you using Udp or Tcp?

    You could logout when the server is raising the disconnect event in you server application, look for OnDisconnect.
    You could also install the photon counters and have a look at the connection and peer counters.

    -Philip
  • Hello Philip, thanks for replying!

    I'm using Photon 3. The protocol is UDP.
    What do you mean by logout? When the users leaves a session, it is just "disconnected", in my system. Is there a Logout status, in addition to the Disconnect one? I know about the OnDisconnect, do you recommend any specific algorithm in it?

    How could the counters help? I don't know because I've never used it.

    Thanks for your help!

    Vitor
  • Tobias
    Options
    I guess you call Disconnect.
    This is not an immediate disconnection but sends a message to the server about the coming disconnection.
    If you connect a new client immediately, then this minor timing issue might cause peers to be rejected.

    OnDisconnect sounds like you are using Photon Unity Networking on the client side? Or what is your client?
  • Yes, I'm using Unity on client side.

    What I want is something like a "Disconnected" status, which means "this on is surely out!". I imagined the Disconnect did it. Which is the common solution for having a "Disconnected" status similar?
  • Tobias
    Options
    The callback OnDisconnectedFromPhoton marks the state you are looking for.
    If the server counts a user a few seconds longer might depend on the update rate between game server and master or some other timing related cause. I didn't investigate yet. Is this very important to you?
  • I'll probably change my test to keep trying reconnection of new users while there is no space among the 100 slots. I may get what I want with this algorithm.
    Thank you for your help!