public class SocketAddress extends Object
| Modifier and Type | Field and Description |
|---|---|
private InetAddress |
addr
The IP address of the Socket Address
|
private String |
hostname
The hostname of the Socket Address
|
private int |
port
The port number of the Socket Address
|
| Constructor and Description |
|---|
SocketAddress(String hostname,
int port)
Creates a socket address from a hostname and a port number.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Compares this object against the specified object.
|
InetAddress |
getAddress()
Gets the
InetAddress. |
String |
getHostname()
Gets the
hostname. |
int |
getPort()
Gets the port number.
|
int |
hashCode() |
InetAddress |
resetAddr()
Resolves the IP address for this hostname, don't use an eventually
caching address.
|
String |
toString()
Constructs a string representation of this InetSocketAddress.
|
private String hostname
private InetAddress addr
private int port
public SocketAddress(String hostname, int port)
hostname - the Host nameport - The port numberpublic InetAddress resetAddr()
public int getPort()
public String getHostname()
hostname.public InetAddress getAddress()
InetAddress.null if it is unresolved.public boolean equals(Object obj)
Copyright © 2022 ScalAgent D.T.. All rights reserved.