public class NetworkUtils
extends java.lang.Object
Constructor and Description |
---|
NetworkUtils() |
Modifier and Type | Method and Description |
---|---|
java.net.InetAddress |
getIp4NonLoopbackAddressOfThisMachine()
Returns a non-loopback IP4 hostname of the local host.
|
java.lang.String |
getIpOfLoopBackIp4() |
static java.lang.String |
getNetWorkDiags() |
java.lang.String |
getNonLoopbackAddressOfThisMachine()
Used by the mobile emulators that refuse to access localhost or 127.0.0.1 The IP4/IP6
requirements of this method are as-of-yet unspecified, but we return the string that is
associated with the IP4 interface
|
java.lang.String |
getPrivateLocalAddress() |
static void |
main(java.lang.String[] args) |
java.lang.String |
obtainLoopbackIp4Address()
Returns a single address that is guaranteed to resolve to an ipv4 representation of localhost
This may either be a hostname or an ip address, dependending if we can guarantee what that the
hostname will resolve to ip4.
|
public java.lang.String getPrivateLocalAddress()
public java.lang.String getNonLoopbackAddressOfThisMachine()
public java.net.InetAddress getIp4NonLoopbackAddressOfThisMachine()
public java.lang.String obtainLoopbackIp4Address()
public java.lang.String getIpOfLoopBackIp4()
public static java.lang.String getNetWorkDiags()
public static void main(java.lang.String[] args)