Search Unity

Can't get simple network communications working in UWP

Discussion in 'Windows' started by GearKlik, Sep 19, 2017.

  1. GearKlik

    GearKlik

    Joined:
    Sep 21, 2015
    Posts:
    58
    Hi all, I'm trying to add some simple network functionality between a Win Store Unity app and the editor.

    I'm trying to use UnityEngine.Networking.NetworkServerSimple and UnityEngine.Networking.NetworkClient to create a simple client-server setup. This works fine in the editor but I can't get it to work when compiled to UWP. I have all the network capabilities set in the player settings, still nothing.

    What am I missing?

    Any suggestions for best simple networking solution for UWP apps built with Unity?

    FYI

    TNKS!

    G
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Are you trying to communicate between 2 different machines or between 2 apps running on the same machine? I believe the latter is blocked by the OS intentionally.

    It should work fine to communicate over the network.
     
  3. GearKlik

    GearKlik

    Joined:
    Sep 21, 2015
    Posts:
    58
    Thanks for the tip! I've just discovered this :( As this is for an internal testing tool I can use CheckNetIsolation.exe to enable local loopback. FYI even with enabling local loopback you still can't listen to ports with UWP and have other apps on the same computer connect to them, UWP can only be a client.

    https://msdn.microsoft.com/en-us/windows/hh780593.aspx
     
  4. GearKlik

    GearKlik

    Joined:
    Sep 21, 2015
    Posts:
    58
    I can confirm this morning that loopback works if you have it enabled and using the UWP Unity app as the client and the Editor as the server.