public class TcpIpAddress extends java.lang.Object implements IAddress
TcpIpAddress
identifies an Endpoint
of a socket connection
by its unique pair of IP address and port number.Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
IP_PARAMETER |
protected java.net.InetAddress |
m_ipAddress
The IP address.
|
protected int |
m_port
The port number.
|
private static java.lang.String |
PORT_PARAMETER |
static java.lang.String |
TRANSPORT_IDENTIFIER |
Constructor and Description |
---|
TcpIpAddress(Endpoint a_baseAddress)
Creates a new
TcpIpAddress , where the values for port and IP
address are determined from the given Endpoint. |
TcpIpAddress(java.net.InetAddress a_ipAddress,
int a_port)
Creates a new
TcpIpAddress based on the given InetAddress
and port. |
TcpIpAddress(java.lang.String a_host,
int a_port)
Creates a new
TcpIpAddress based on the given host and port. |
Modifier and Type | Method and Description |
---|---|
AddressParameter[] |
getAllParameters()
Returns an array of
AddressParameter objects. |
java.lang.String |
getHostname()
Returns the current host name of the internal IP address.
|
java.net.InetAddress |
getIPAddress()
Returns the IP address.
|
int |
getPort()
Returns the port.
|
java.lang.String |
getTransportIdentifier()
Returns a string describing the transport protocol.
|
public static final java.lang.String TRANSPORT_IDENTIFIER
private static final java.lang.String IP_PARAMETER
private static final java.lang.String PORT_PARAMETER
protected int m_port
protected java.net.InetAddress m_ipAddress
public TcpIpAddress(java.lang.String a_host, int a_port)
TcpIpAddress
based on the given host and port. The
IP address is determined by a host lookup. If that fails, the IP address
is null.a_host
- The host name or a string of an IP address.a_port
- The port number.public TcpIpAddress(java.net.InetAddress a_ipAddress, int a_port)
TcpIpAddress
based on the given InetAddress
and port.a_ipAddress
- a_port
- The port number.public TcpIpAddress(Endpoint a_baseAddress) throws AddressMappingException
TcpIpAddress
, where the values for port and IP
address are determined from the given Endpoint.AddressMappingException
public java.net.InetAddress getIPAddress()
public int getPort()
public java.lang.String getHostname()
public AddressParameter[] getAllParameters()
AddressParameter
objects.getAllParameters
in interface IAddress
public java.lang.String getTransportIdentifier()
getTransportIdentifier
in interface IAddress
Copyright © 2023. All rights reserved.