Package | Description |
---|---|
java.net |
Network communication through TCP and UDP sockets or URLs.
|
tijos.framework.networkcenter.ntp |
Network time protocol client class
|
Modifier and Type | Class and Description |
---|---|
class |
Inet4Address |
class |
Inet6Address |
Modifier and Type | Method and Description |
---|---|
InetAddress |
InetSocketAddress.getAddress()
Returns the
InetAddress or null if its unresolved |
InetAddress |
DatagramPacket.getAddress()
Returns the address that this packet is being sent to or, if it was used to
receive a packet, the address that is was received from.
|
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 InetAddress |
InetAddress.getByLiteral(String literal)
Returns an InetAddress object representing the IP address of the given
literal IP address in dotted decimal format such as "127.0.0.1".
|
static InetAddress |
InetAddress.getByName(String hostname)
Returns an InetAddress object representing the IP address of the given
hostname.
|
InetAddress |
Socket.getInetAddress()
Returns the address of the remote end of the socket.
|
InetAddress |
ServerSocket.getInetAddress()
This method returns the local address to which this socket is bound
|
InetAddress |
DatagramSocket.getInetAddress()
This method returns the remote address to which this socket is connected.
|
InetAddress |
Socket.getLocalAddress()
Returns the local address to which this socket is bound.
|
InetAddress |
DatagramSocket.getLocalAddress()
Returns the local address this datagram socket is bound to.
|
static InetAddress |
InetAddress.getLocalHost()
Returns an InetAddress object representing the address of the current host.
|
Modifier and Type | Method and Description |
---|---|
void |
DatagramSocket.connect(InetAddress address,
int port)
This method connects this socket to the specified address and port.
|
void |
DatagramPacket.setAddress(InetAddress address)
This sets the address to which the data packet will be transmitted.
|
Constructor and Description |
---|
DatagramPacket(byte[] buf,
int length,
InetAddress address,
int port)
Initializes a new instance of
DatagramPacket for transmitting
packets across the network. |
DatagramPacket(byte[] buf,
int offset,
int length,
InetAddress address,
int port)
Initializes a new instance of
DatagramPacket for transmitting
packets across the network. |
DatagramSocket(int port,
InetAddress addr)
Initializes a new instance of
DatagramSocket that binds to the
specified local port and address. |
InetSocketAddress(InetAddress addr,
int port)
Constructs an InetSocketAddress instance.
|
ServerSocket(int port,
int backlog,
InetAddress bindAddr)
Creates a server socket and binds it to the specified port.
|
Socket(InetAddress address,
int port)
Initializes a new instance of
Socket and connects to the
address and port number specified as arguments. |
Socket(InetAddress host,
int port,
boolean stream)
Deprecated.
Use the
DatagramSocket class to create
datagram oriented sockets. |
Socket(InetAddress address,
int port,
InetAddress localAddr,
int localPort)
Initializes a new instance of
Socket and connects to the
address and port number specified as arguments, plus binds to the
specified local address and port. |
Socket(String host,
int port,
InetAddress localAddr,
int localPort)
Initializes a new instance of
Socket that connects to the
named host on the specified port and binds to the specified local address
and port. |
Modifier and Type | Method and Description |
---|---|
InetAddress |
TimeInfo.getAddress()
Get host address from message datagram if available
|
Modifier and Type | Method and Description |
---|---|
TimeInfo |
NTPUDPClient.getTime(InetAddress host)
Retrieves the time information from the specified server on the default NTP
port and returns it.
|
TimeInfo |
NTPUDPClient.getTime(InetAddress host,
int port)
Retrieves the time information from the specified server and port and returns
it.
|