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

Question How to handle maximum connection count?

Discussion in 'Unity Transport' started by Kichang-Kim, May 26, 2021.

  1. Kichang-Kim


    Oct 19, 2010
    Hi, WIth old LLAPI, there is HostTopology class for configuring maximum connection count for server. But I found that Unity Transport does not have any API for that.

    How to handle maximum connection count for Unity Transport? should I manually disconnect it after NetworkDriver.Accept()? or should not call NetworkDriver.Accept() while connection count reached to max?

  2. timjohansson


    Unity Technologies

    Jul 13, 2016
    I would recommend Accept + Disconnect. The connections are actually accepted by the NetworkDriver update job and stored in a queue of new connections. The Accept method simply pops from that queue, which means the connection is established and receiving events which you must process even if you do not call accept.
    Kichang-Kim likes this.