diff options
Diffstat (limited to 'sources/protocols/implementations/ExternalTimeSyncProtocol.java')
| -rw-r--r-- | sources/protocols/implementations/ExternalTimeSyncProtocol.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sources/protocols/implementations/ExternalTimeSyncProtocol.java b/sources/protocols/implementations/ExternalTimeSyncProtocol.java index 5a55d89..63edcaf 100644 --- a/sources/protocols/implementations/ExternalTimeSyncProtocol.java +++ b/sources/protocols/implementations/ExternalTimeSyncProtocol.java @@ -1,22 +1,46 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ package protocols.implementations; import core.VSMessage; import protocols.VSProtocol; +// TODO: Auto-generated Javadoc +/** + * The Class ExternalTimeSyncProtocol. + */ public class ExternalTimeSyncProtocol extends VSProtocol { + + /** The request time. */ private long requestTime; + + /** The waiting for response. */ private boolean waitingForResponse; + /** + * Instantiates a new external time sync protocol. + */ public ExternalTimeSyncProtocol() { setClassname(getClass().toString()); } + /* (non-Javadoc) + * @see events.VSEvent#onInit() + */ protected void onInit() { } + /* (non-Javadoc) + * @see protocols.VSProtocol#onClientReset() + */ protected void onClientReset() { } + /* (non-Javadoc) + * @see protocols.VSProtocol#onClientStart() + */ protected void onClientStart() { requestTime = process.getTime(); waitingForResponse = true; @@ -27,6 +51,9 @@ public class ExternalTimeSyncProtocol extends VSProtocol { sendMessage(message); } + /* (non-Javadoc) + * @see protocols.VSProtocol#onClientRecv(core.VSMessage) + */ protected void onClientRecv(VSMessage recvMessage) { if (!recvMessage.getBoolean("isServerResponse")) return; @@ -45,9 +72,15 @@ public class ExternalTimeSyncProtocol extends VSProtocol { process.setTime(newTime); } + /* (non-Javadoc) + * @see protocols.VSProtocol#onServerReset() + */ protected void onServerReset() { } + /* (non-Javadoc) + * @see protocols.VSProtocol#onServerRecv(core.VSMessage) + */ protected void onServerRecv(VSMessage recvMessage) { if (!recvMessage.getBoolean("isClientRequest")) return; @@ -59,6 +92,9 @@ public class ExternalTimeSyncProtocol extends VSProtocol { sendMessage(message); } + /* (non-Javadoc) + * @see protocols.VSProtocol#toString() + */ public String toString() { return super.toString(); //+ "; " + prefs.getString("lang.requesttime") + ": " + requestTime; } |
