Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Resolved Changing disconnect time out in an already started server

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

  1. idominguez

    idominguez

    Joined:
    Mar 24, 2022
    Posts:
    1
    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.
    transport_disconnect_timeout.PNG
    We haven't found anything related to this in the documentation, is it possible to do some like this?
    Thanks.
     
  2. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    276
    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.