Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

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?