Hololens/Lib/UdpSockets.cs
//###########################################################################################
/// <summary>
/// Check the local IP adress of the device itself.
/// If the current adress format is not IPv4, return the loopback IPv4 adress.
/// </summary>
/// <returns> IPv4 local adress </returns>
Check the local IP adress of the device itself.
If the current adress format is not IPv4, return the loopback IPv4 adress.
Check the local IP adress of the device itself . If the current adress format is not IPv4 return the loopback IPv4 adress .
private string LocalIp()
        {
            foreach (HostName localHostName in NetworkInformation.GetHostNames())
            {
                if (localHostName.Type == HostNameType.Ipv4)
                {
                    return localHostName.ToString();
                }
            }
            return "127.0.0.1";
        }
private string LocalIp ( ) { foreach ( HostName localHostName in NetworkInformation . GetHostNames ( ) ) { if ( localHostName . Type == HostNameType . Ipv4 ) { return localHostName . ToString ( ) ; } } return " " ; }
Check the local IP adress of the device itself.
Check the local IP adress of the device itself .
IPv4 local adress
IPv4 local adress