public final class DaytimeUDPClient extends DatagramSocketClient
DaytimeTCPClient| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT
The default daytime port.
|
_isOpen_, _socket_, _socketFactory_, _timeout_| Constructor and Description |
|---|
DaytimeUDPClient() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getTime(java.net.InetAddress host)
Same as
getTime(host, DaytimeUDPClient.DEFAULT_PORT); |
java.lang.String |
getTime(java.net.InetAddress host,
int port)
Retrieves the time string from the specified server and port and
returns it.
|
close, getDefaultTimeout, getLocalAddress, getLocalPort, getSoTimeout, isOpen, open, open, open, setDatagramSocketFactory, setDefaultTimeout, setSoTimeoutpublic static final int DEFAULT_PORT
public java.lang.String getTime(java.net.InetAddress host,
int port)
throws java.io.IOException
host - The address of the server.port - The port of the service.java.io.IOException - If an error occurs while retrieving the time.public java.lang.String getTime(java.net.InetAddress host)
throws java.io.IOException
getTime(host, DaytimeUDPClient.DEFAULT_PORT);java.io.IOExceptionCopyright © 1997-2002 Daniel F. Savarese. All Rights Reserved.