org.apache.commons.net.daytime
public final class DaytimeTCPClient extends SocketClient
connect
and call getTime()
to retrieve the daytime
string, then
call disconnect
to close the connection properly.
Field Summary | |
---|---|
static int | DEFAULT_PORT The default daytime port. |
Constructor Summary | |
---|---|
DaytimeTCPClient()
The default DaytimeTCPClient constructor. |
Method Summary | |
---|---|
String | getTime()
Retrieves the time string from the server and returns it. |
DEFAULT_PORT
.
disconnect
after calling this method. To retrieve another time, you must
initiate another connection with
connect
before calling getTime()
again.
Returns: The time string retrieved from the server.
Throws: IOException If an error occurs while fetching the time string.