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.
  2. Dismiss Notice

Multiple consecutive connections with Unity relay

Discussion in 'Relay' started by Selmar, Apr 14, 2023.

  1. Selmar

    Selmar

    Joined:
    Sep 13, 2011
    Posts:
    55
    Hey,

    I've linked up my application to unity relay, everything is working fine in the first session.

    Now, I've tried to shutdown the session (using NetworkManager.Instance.Shutdown) and then starting a new one (via StartHost). However, every time I try this I eventually receive these two messages:

    Needing to recreate the Relay allocation is not convenient, because this implies re-communicating joincodes.

    What am I doing wrong? Or is this not possible?
     
  2. Selmar

    Selmar

    Joined:
    Sep 13, 2011
    Posts:
    55
    I did read in the documentation that initially there's only 10 seconds to bind the relay, and I see here that is trying to bind, so I can understand why that would not work.

    I suppose there is no way to separate the connection from the hosted session..?
     
  3. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    223
    Do you create a new allocation when trying to connect again?
     
    Selmar likes this.
  4. Selmar

    Selmar

    Joined:
    Sep 13, 2011
    Posts:
    55
    No, I did not, it was not in a place in the flow where I could copy paste join codes again. However, I did start thinking along this direction. I can communicate the join code via the old connection, then kill the connection, then start a new session. This should work fine!