Package org.drasyl.example.time
Class TimeServer
- java.lang.Object
-
- org.drasyl.DrasylNode
-
- org.drasyl.example.time.TimeServer
-
public class TimeServer extends DrasylNode
Starts a node which replies the time in seconds since midnight on January first 1900, when receiving an empty message. Based on the Time Protocol.- See Also:
TimeClient
-
-
Field Summary
Fields Modifier and Type Field Description static long
UNIX_TIME_OFFSET
-
Constructor Summary
Constructors Modifier Constructor Description protected
TimeServer(DrasylConfig config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(String[] args)
void
onEvent(Event event)
-
Methods inherited from class org.drasyl.DrasylNode
getBestEventLoop, getVersion, identity, irrevocablyTerminate, pipeline, send, send, shutdown, start
-
-
-
-
Field Detail
-
UNIX_TIME_OFFSET
public static final long UNIX_TIME_OFFSET
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TimeServer
protected TimeServer(DrasylConfig config) throws DrasylException
- Throws:
DrasylException
-
-
Method Detail
-
onEvent
public void onEvent(@NonNull Event event)
- Specified by:
onEvent
in classDrasylNode
-
main
public static void main(String[] args) throws DrasylException, ExecutionException, InterruptedException
-
-