Package | Description |
---|---|
java.net |
Network communication through TCP and UDP sockets or URLs.
|
Modifier and Type | Method and Description |
---|---|
static InetAddress[] |
InetAddress.getAllByName(String hostname)
Returns an array of InetAddress objects representing all the host/ip
addresses of a given host, given the host's name.
|
static InetAddress |
InetAddress.getByAddress(byte[] addr)
Returns an InetAddress object given the raw IP address.
|
static InetAddress |
InetAddress.getByAddress(String host,
byte[] addr)
Creates an InetAddress based on the provided host name and IP address.
|
static Inet6Address |
Inet6Address.getByAddress(String host,
byte[] addr,
int scopeId)
Creates a scoped Inet6Address where the scope has an integer id.
|
static InetAddress |
InetAddress.getByName(String hostname)
Returns an InetAddress object representing the IP address of the given
hostname.
|
static InetAddress |
InetAddress.getLocalHost()
Returns an InetAddress object representing the address of the current host.
|
Constructor and Description |
---|
Socket(String host,
int port)
Initializes a new instance of
Socket and connects to the
hostname and port specified as arguments. |