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 Exception: Could not bind socket when using Unity Transport package in Editor Windows

Discussion in 'Entity Component System' started by ShadLady, Nov 22, 2020.

  1. ShadLady

    ShadLady

    Joined:
    Mar 19, 2019
    Posts:
    8
    When I run the new NetCode multiplayer project, I got this error
    Code (CSharp):
    1. Exception: Could not bind socket
    2. Unity.Networking.Transport.BaselibNetworkInterface.Initialize (Unity.Networking.Transport.INetworkParameter[] param) (at Library/PackageCache/com.unity.transport@0.4.1-preview.1/Runtime/BaselibNetworkInterface.cs:197)
    3. Unity.Networking.Transport.NetworkDriver..ctor (Unity.Networking.Transport.INetworkInterface netIf, Unity.Networking.Transport.INetworkParameter[] param) (at Library/PackageCache/com.unity.transport@0.4.1-preview.1/Runtime/NetworkDriver.cs:480)
    4. Unity.Networking.Transport.NetworkDriver.Create (Unity.Networking.Transport.INetworkParameter[] param) (at Library/PackageCache/com.unity.transport@0.4.1-preview.1/Runtime/NetworkDriver.cs:454)
    When I debuged the BaselibNetworkInterface.Bind method, I found the Error.code is UnexpectedError, nativeErrorCode is 10045, nativeCodeType is PlatformDefined.

    Unity version: 2020.1.14f1c1 Personal
    Platform: Windows 10

    It's ok when playing on another computer. I think it's the problem of this PC, but don't know how to fix it. That really drive me mad. Will someone help me?:(
     
    Last edited: Nov 22, 2020
  2. myxolobe

    myxolobe

    Joined:
    Dec 7, 2016
    Posts:
    9
    Probably a permissions issue. Try running it as Administrator and see if that resolves the problem.
     
  3. ShadLady

    ShadLady

    Joined:
    Mar 19, 2019
    Posts:
    8
    Thanks for your reply. I've tried that, still didn't work. By the way I can run DOTSSample on the same machine which use older version of unity.transport and netcode.
     
  4. myxolobe

    myxolobe

    Joined:
    Dec 7, 2016
    Posts:
    9
    Maybe that computer has something running on whatever port the project is connecting on. There should be a way to check what ports are in use and which process has the socket, depending on your OS.
     
  5. sihengheng

    sihengheng

    Joined:
    Jul 23, 2020
    Posts:
    2
    Have you got this issue resolved?
    I am facing the same issue here :(, please let me know if you have any progress, any help will be appreciated