Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Resolved Changing disconnect time out in an already started server

Discussion in 'Unity Transport' started by idominguez, May 4, 2023.

  1. idominguez


    Mar 24, 2022
    We want to dinamically change the disconnect timeout parameter of the network driver in an already initialized server, so we can manage the periods of inactivity of the clients depending on the situation, thus preventing accidental disconnections.
    We haven't found anything related to this in the documentation, is it possible to do some like this?
  2. simon-lemay-unity


    Unity Technologies

    Jul 19, 2021
    Unfortunately, it is not possible to change these timeouts after initialization.

    If you're worried about "quiet" periods in the game causing an accidental disconnection, then I'd suggest configuring an appropriate timeout for heartbeats, which are sent automatically when nothing happens on a connection after some (configurable) time. Of course, that would not work if these "quiet" periods are due to users going offline. In such situations, I would recommend implementing a more robust reconnection mechanism. You can look at how Boss Room implements one for inspiration.
    idominguez likes this.