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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug Failing to bind if using UnityTransport.ConnectionData field

Discussion in 'Unity Transport' started by Tramplex, Feb 13, 2023.

  1. Tramplex


    Dec 10, 2016
    I have an issue when any attempt to bind to any port via Unity Transport (using it in conjunction with Network for GameObjects) leands to failing to bind and shutdown of NetworkManager.
    I've spent last 6 hours debugging everything on my machine down to WindowsAPI calls. I'm glad that i finally understood what was the issue, but it would have been incredibly better if that didn't happen at all.
    What was the deal:
    I have been assigning ip address and port via creating new ConnectionData() and assigning it to UnityTransport component's ConnectionData field.
    When i switched to using UnityTransport.SetConnectionData() it started successfully binding to all ports.
    So what do i want with this post on forums?
    Guys you really shouldn't give access to a field if assigning it breaks things. Or at least warn in comments to it that it may not work correctly.
    So to anyone struggling to make UnityTransport to start: just make sure youre not doing what i did.