java.net
public class InetSocketAddress extends SocketAddress
Since: 1.4
Constructor Summary | |
---|---|
InetSocketAddress(InetAddress addr, int port)
Constructs an InetSocketAddress instance.
| |
InetSocketAddress(int port)
Constructs an InetSocketAddress instance.
| |
InetSocketAddress(String hostname, int port)
Constructs an InetSocketAddress instance.
|
Method Summary | |
---|---|
static InetSocketAddress | createUnresolved(String hostname, int port)
Creates an unresolved InetSocketAddress object.
|
boolean | equals(Object obj)
Test if obj is a InetSocketAddress and
has the same address and port
|
InetAddress | getAddress()
Returns the InetAddress or
null if its unresolved
|
String | getHostName()
Returns hostname
|
int | getPort()
Returns the port
|
int | hashCode()
Returns the hashcode of the InetSocketAddress
|
boolean | isUnresolved()
Checks wether the address has been resolved or not
|
String | toString()
Returns the InetSocketAddress as string
|
Parameters: addr Address of the socket port Port if the socket
Throws: IllegalArgumentException If the port number is illegel
Parameters: port Port if the socket
Throws: IllegalArgumentException If the port number is illegal
Parameters: hostname The hostname for the socket address port The port for the socket address
Throws: IllegalArgumentException If the port number is illegal or the hostname argument is null
InetSocketAddress
object.
Parameters: hostname The hostname for the socket address port The port for the socket address
Throws: IllegalArgumentException If the port number is illegal or the hostname argument is null
Since: 1.5
InetSocketAddress
and
has the same address and port
Parameters: obj The obj to compare this address with.
Returns: True if obj is equal.
InetAddress
or
null
if its unresolved
Returns: The IP address of this address.
hostname
Returns: The hostname of this address.
port
Returns: The port of this address.
InetSocketAddress
Returns: The hashcode for this address.
Returns: True if address is unresolved.
InetSocketAddress
as string
Returns: A string representation of this address.