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

Question Binding with Relay

Discussion in 'NetCode for ECS' started by frimarichard, Jul 21, 2023.

  1. frimarichard

    frimarichard

    Joined:
    Jul 24, 2017
    Posts:
    31
    I'm having a lot of trouble trying to integrate Relay into my project.

    The Frontend sample creates a join code, but after a minute the host connection times out with the error: "Failed to establish connection with the Relay server". I see this same error when trying to integrate the sample into my own project. I've tried using both udp and dtls connection types.

    The problem seems to stem from RelayLayer.ProcessReceivedMessages() never having a count value larger than 0, and so the host's binding is never established.

    I've also tried the Simple Relay Sample (using UTP) from the Relay package, which has the same error. Also, although I can create a join code with that sample, I cannot connect to it from another Unity instance (join code not found). I have verified that the local player ID is different.

    On the UGS dashboard for the project, I do sometimes see "number of hosted allocations" increasing, although with the number of tests I'm trying and what seems to be a delay in updating the dashboard data, I'm not sure exactly where it's coming from. The "total bandwidth consumption" is never above 0kb.

    Unity: 2022.3.5f1
    Entities: 1.0.11
    Netcode: 1.0.12

    Any tips or advice would be much appreciated.
     
  2. frimarichard

    frimarichard

    Joined:
    Jul 24, 2017
    Posts:
    31
    Nevermind, turns out our firewall was blocking traffic on the Relay port.