Some players "Server failed to bind" when using Unity Relay

I’m running into an issue where some players can’t bind to servers using Unity Relay. (It’s a small percentage of the players, but large enough that it doesn’t seem entirely hardware specific)

I assume it’s related to ports being blocked or similar. The default port in the transport script is using 7777, but I’m pretty sure that gets overwritten when the Relay service is being used. This particular case, a player can’t host or join games despite two other people on their same network being able to play and connect just fine. Which seems to rule out this being a router issue.

Is there an up-to-date list of the Ports used by the Relay Service? I saw a few online but they were posted last year. When logging out the port when I successfully connect, I get 37000 - but not sure if this is always 37000 or this changes as well.

Any help with this is greatly appreciated!

The port range used by Unity Relay servers is 37000-37100.

But I’m not sure that this is a port-related issue. When using Unity Relay, we always bind the socket to an ephemeral port which should pretty much always succeed. It seems here there might be an issue with creating the socket in the first place (the error message is the same).

If this is only happening on Windows, then it could be caused by the presence of TDI filters on the machine (an old deprecated Windows functionality often used in old antivirus software, network monitoring tools, and game accelerators that are popular in China). We’ve addressed this issue, but the fix requires a relatively recent editor (at least 2021.3.22f1, 2022.2.13f1, 2023.1.0b9, or 2023.2.0a7).

Otherwise failure to create a socket can sometimes occur because of issues with OS permissions, like a mobile application lacking the permissions to access the network. Technically the socket could also fail to bind if the OS is running out of ephemeral ports, but that’s unlikely.

Updating to a new engine version (2021.3.28f1) and netcode package (1.5.1) did the trick! Thanks so much for your help, Simon!