public interface NetUtil
| Modifier and Type | Method | Description |
|---|---|---|
static java.lang.String |
addPortIfMissing(java.lang.String addr,
int defaultPort) |
|
static java.net.InetAddress |
getHostAddr() |
Tries to resolve 1st enabled external network interface IP address.
|
static long |
getHostAddrCode() |
|
static java.lang.String |
getHostAddrString() |
static java.net.InetAddress getHostAddr()
throws java.net.SocketException
java.net.SocketException - if failed to resolve an interface addressjava.lang.IllegalStateException - if no network interface foundstatic java.lang.String getHostAddrString()
throws java.net.SocketException,
java.lang.IllegalStateException
java.net.SocketExceptionjava.lang.IllegalStateExceptionstatic long getHostAddrCode()
throws java.net.SocketException,
java.lang.IllegalStateException
java.net.SocketExceptionjava.lang.IllegalStateExceptionstatic java.lang.String addPortIfMissing(java.lang.String addr,
int defaultPort)