Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Networking LocalDiscovery IP Problem

Discussion in '5.2 Beta' started by pojoih, Aug 25, 2015.

  1. pojoih


    Mar 30, 2013
    First of all, I did not find the LocalDiscovery component in 5.2.0f2, so I used the one Sean wrote from here:

    I'm trying to get this work with two Android devices, but I've noticed the Broadcastmessage at the sender contains the port and networkaddress configured in the networkmanager. Shouldn't it use the devices IP address at runtime?
    Code (CSharp):
    1. if (NetworkManager.singleton != null)
    2. {
    3. broadcastData = "NetworkManager:"+NetworkManager.singleton.networkAddress + ":" + NetworkManager.singleton.networkPort;
    4. }
    Otherwise I'm getting "localhost:7777" on the client side, which is not usable for obvious reasons :). How do a I find out my own IP address on android devices?