All Packages Class Hierarchy This Package Previous Next Index
Class com.oroinc.net.DaytimeUDPClient
java.lang.Object
|
+----com.oroinc.net.DatagramSocketClient
|
+----com.oroinc.net.DaytimeUDPClient
- public final class DaytimeUDPClient
- extends DatagramSocketClient
The DaytimeUDPClient class is a UDP implementation of a client for the
Daytime protocol described in RFC 867. To use the class, merely
open a local datagram socket with
open
and call getTime to retrieve the daytime
string, then
call close
to close the connection properly. Unlike
DaytimeTCPClient ,
successive calls to getTime are permitted
without re-establishing a connection. That is because UDP is a
connectionless protocol and the Daytime protocol is stateless.
Copyright © 1997 Original Reusable Objects, Inc.
All rights reserved.
- See Also:
- DaytimeTCPClient
-
DEFAULT_PORT
- The default daytime port.
-
DaytimeUDPClient()
-
-
getTime(InetAddress)
- Same as
getTime(host, DaytimeUDPClient.DEFAULT_PORT);
-
getTime(InetAddress, int)
- Retrieves the time string from the specified server and port and
returns it.
DEFAULT_PORT
public static final int DEFAULT_PORT
- The default daytime port. It is set to 13 according to RFC 867.
DaytimeUDPClient
public DaytimeUDPClient()
getTime
public String getTime(InetAddress host,
int port) throws IOException
- Retrieves the time string from the specified server and port and
returns it.
- Parameters:
- host - The address of the server.
- port - The port of the service.
- Returns:
- The time string.
- Throws: IOException
- If an error occurs while retrieving the time.
getTime
public String getTime(InetAddress host) throws IOException
- Same as
getTime(host, DaytimeUDPClient.DEFAULT_PORT);
All Packages Class Hierarchy This Package Previous Next Index