Search Unity

Bug [1.0.8] Forcing using the NetworkEndPoint.Loopback

Discussion in 'NetCode for ECS' started by optimise, May 12, 2023.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    I haven't test the new player runtime build yet but I guess it's related to this issue (https://forum.unity.com/threads/1-0...ds-client-server-on-android-platform.1416657/). Is that the fix still not merged into 1.0.8 yet?

    The requested playmode type is Client/Server but the client is trying to connect to address xxx:7979 that is not the loopback address. Forcing using the NetworkEndPoint.Loopback; family (IPV4/IPV6) and port will be preserved
    UnityEngine.Debug:LogWarning (object)
    Unity.NetCode.NetworkStreamDriver:SanitizeConnectAddress (Unity.Networking.Transport.NetworkEndpoint&,int) (at ./Library/PackageCache/com.unity.netcode@1.0.8/Runtime/Connection/NetworkStreamDriver.cs:102)
    Unity.NetCode.NetworkStreamDriver:Connect (Unity.Entities.EntityManager,Unity.Networking.Transport.NetworkEndpoint,Unity.Entities.Entity) (at ./Library/PackageCache/com.unity.netcode@1.0.8/Runtime/Connection/NetworkStreamDriver.cs:177)
    Scene_LoadClientGameSubSceneSystem:OnUpdate () (at Assets/Features/SceneClient/Scene_LoadClientGameSubSceneSystem.cs:279)
    Unity.Entities.SystemBase:Update () (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/SystemBase.cs:418)
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/ComponentSystemGroup.cs:735)
    Unity.Entities.ComponentSystemGroup:OnUpdate () (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/ComponentSystemGroup.cs:693)
    Unity.Entities.SystemBase:Update () (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/SystemBase.cs:418)
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/ComponentSystemGroup.cs:735)
    Unity.Entities.ComponentSystemGroup:OnUpdate () (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/ComponentSystemGroup.cs:693)
    Unity.Entities.InitializationSystemGroup:OnUpdate () (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/DefaultWorld.cs:169)
    Unity.Entities.SystemBase:Update () (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/SystemBase.cs:418)
    Unity.Entities.ScriptBehaviourUpdateOrder/DummyDelegateWrapper:TriggerUpdate () (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/ScriptBehaviourUpdateOrder.cs:526)
     
  2. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Just tested player runtime build it's working properly. I guess the warning is not affecting game build but still nice to fix at next patch release
     
  3. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
    I just want to mention that this is also still occurring for me in editor. I can see in the delta of the package itself from the recent release that the sanitation function is now ifdef to editor and server builds only which is strange.

    https://github.com/needle-mirror/co...cc813670aa1c6702caaea1b28e24aa55173518e437786

    Connect is only called by clients requesting connection with the server but the sanitation function only happens in server and editor versions, not client nor client/server builds, is this intended?
     
  4. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    894
    The check is correct.
    For the client: If the Driver is using an IPCNetworkInterface (that is the default for Client/Server mode if the simulator is disabled in the editor) the address must be the Loopback (Transport triggers an exception if that is not the case).
    It does not break any behaviour or cause issues. It just forcing the address as it should be for the local connection.

    For the server: it has two driver (default configuration) in client/server mode: one that use a socket, bound to whatever address you pass, one that use IPCNetworkInterface and that it is bound to 127.0.0.1:xxx or any:xxx.
     
    Kmsxkuse likes this.
  5. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    894
    If the client use a socket driver (default for build that are Client Only) there is no check to do.
    For server build, also not sanctification happen (no IPC interface).

    Apart the warning, is this causing any problem?
     
    Kmsxkuse likes this.
  6. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
    I just deleted library and built my client/server project again. Used that as the host and the editor in Client mode to connect.

    The warning disappeared and the connection worked. Seems like an old netcode version when I last build tested my project.

    Everything works on my end. Thanks.
     
    PolarTron likes this.