Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Networking LocalDiscovery IP Problem

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

  1. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    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?