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

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    228
    First of all, I did not find the LocalDiscovery component in 5.2.0f2, so I used the one Sean wrote from here: http://forum.unity3d.com/threads/ho...ry-with-networktransport.323525/#post-2099741

    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. }
    5.  
    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?