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

Bug Unable to connect clients to a server when using NGO + Relay

Discussion in 'Relay' started by dchipman, Apr 11, 2022.

  1. dchipman

    dchipman

    Joined:
    Jan 4, 2015
    Posts:
    37
    I followed the Relay documentation here for integrating with NGO, and when attempting to connect to a server using a join code, the client never connects and then eventually times out with the message `Failed to connect to server`, but no other failure information is available. From debugging, the server never appears to receive any network messages nor reaches connection approval, and everything appears to bind correctly both on server and client. Client gets initialized and sends connection request, but that request seems to just disappear into the void.

    Unity: 2020.3.12f1 LTS
    Relay package: 1.0.1-pre.6
    NGO package: 1.0.0-pre.7
    Not using Lobby service.

    What I've tried so far:
    • Confirmed that direct IP connection using UTP without Relay works fine.
    • Interactive Relay Sample (using UTP) imported via Package Manager works, though this doesn't use NGO
    • Tried to open and run Boss Room sample with 2020.3.30f1 since that uses both Relay and NGO with comparable code, but Lobby package seems to be unavailable right now (fails with `Package [com.unity.services.lobby@1.0.0-pre.6] cannot be found`) so I cannot compile and see if it works.
    • Cross connecting my NGO+Relay with the Interactive Relay Sample via join code (either as client or server) results in the same issue.
    Given the above, I suspect the issue lies somewhere in the integration of NGO x UTP x Relay, but unfortunately was not able to get any other provided Relay+NGO samples working since the Lobby package is refusing to resolve.

    Any ideas on what might be going wrong here, or ideas of where I can dig into to get more information?
     
  2. dchipman

    dchipman

    Joined:
    Jan 4, 2015
    Posts:
    37
    Found a workaround.

    DTLS as recommended by the documentation I mentioned in previous post does not work out of the box, or additional configuration is needed and needs to be added to documentation.

    Not sure if this is a bug, unsupported feature, or if the docs are just wrong.
     
  3. daniel414

    daniel414

    Joined:
    May 13, 2020
    Posts:
    11
    Just curious, what was your workaround, did you just disable DTLS or is there something else? For me that works, but it is not documented.
    Starting from the sample code in the documentation, additionally you have to select the correct ip/port for secure connection:
    The Allocation object has a list of endpoints allocation.ServerEndpoints and you have to manually select the endpoint with endpoint.Secure = true