public interface SocketAddress
inetSocketAddress(int, String)
to create an inet socket address and domainSocketAddress(String)
to create a domain socket addressModifier and Type | Method and Description |
---|---|
static SocketAddress |
domainSocketAddress(String path)
Create a domain socket address from a
path . |
String |
host()
Returns the host name when available or the IP address in string representation.
|
String |
hostAddress()
Returns the host IP address when available or
null as a String. |
String |
hostName()
Returns the host name when available or
null
Domain socket address returns null . |
static SocketAddress |
inetSocketAddress(InetSocketAddress address)
Create a inet socket address from a Java
InetSocketAddress . |
static SocketAddress |
inetSocketAddress(int port,
String host)
Create an inet socket address,
host must be non null and port must be between 0
and 65536 . |
boolean |
isDomainSocket() |
boolean |
isInetSocket() |
String |
path() |
int |
port() |
static SocketAddress |
sharedRandomPort(int id,
String host)
Create an inet socket address that binds to a shared random port identified by
id . |
static SocketAddress sharedRandomPort(int id, String host)
id
.
host
string can be a host name or a host address.
id
- the shared random port idhost
- the hoststatic SocketAddress inetSocketAddress(int port, String host)
host
must be non null
and port
must be between 0
and 65536
.
host
string can be a host name or a host address.
port
- the porthost
- the hoststatic SocketAddress domainSocketAddress(String path)
path
.path
- the address pathstatic SocketAddress inetSocketAddress(InetSocketAddress address)
InetSocketAddress
.
address
- the addressString host()
null
.String hostName()
null
null
.String hostAddress()
null
as a String.
null
.int port()
-1
for a domain socketString path()
null
for inet socket address, empty path represents unnamed domain socket addresses.boolean isInetSocket()
true
for an inet socket addressboolean isDomainSocket()
true
for an domain socket addressCopyright © 2024 Eclipse. All rights reserved.