|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.net.time.TimeTestSimpleServer
public class TimeTestSimpleServer
The TimetSimpleServer class is a simple TCP implementation of a server for the Time Protocol described in RFC 868.
Listens for TCP socket connections on the time protocol port and writes the local time to socket outputStream as 32-bit integer of seconds since midnight on 1 January 1900 GMT. See the spec for details.
Note this is for debugging purposes only and not meant to be run as a realiable time service.
Field Summary | |
---|---|
static int |
DEFAULT_PORT
The default time port. |
static long |
SECONDS_1900_TO_1970
baseline time 1900-01-01T00:00:00 UTC |
Constructor Summary | |
---|---|
TimeTestSimpleServer()
Default constructor for TimetSimpleServer. |
|
TimeTestSimpleServer(int port)
Constructor for TimetSimpleServer given a specific port. |
Method Summary | |
---|---|
void |
connect()
|
int |
getPort()
|
boolean |
isRunning()
|
static void |
main(String[] args)
|
void |
run()
|
void |
start()
Start time service and provide time to client connections. |
void |
stop()
Close server socket. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long SECONDS_1900_TO_1970
public static final int DEFAULT_PORT
Constructor Detail |
---|
public TimeTestSimpleServer()
public TimeTestSimpleServer(int port)
Method Detail |
---|
public void connect() throws IOException
IOException
public int getPort()
public boolean isRunning()
public void start() throws IOException
IOException
public void run()
run
in interface Runnable
public void stop()
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |