Sirikata
|
TimeSyncServer implements the server for a simple time synchronization protocol. More...
#include <TimeSyncServer.hpp>
Public Member Functions | |
TimeSyncServer (Context *ctx, OHDP::Service *ohdp) | |
~TimeSyncServer () | |
Private Member Functions | |
void | handleMessage (const OHDP::Endpoint &src, const OHDP::Endpoint &dst, MemoryReference payload) |
Private Attributes | |
Context * | mContext |
OHDP::Port * | mPort |
TimeSyncServer implements the server for a simple time synchronization protocol.
You give it a Context to get time information and it returns the payload for a response message -- simply package it up in a container frame and send it back to the client.
Sirikata::TimeSyncServer::TimeSyncServer | ( | Context * | ctx, |
OHDP::Service * | ohdp | ||
) |
Sirikata::TimeSyncServer::~TimeSyncServer | ( | ) |
References mPort.
void Sirikata::TimeSyncServer::handleMessage | ( | const OHDP::Endpoint & | src, |
const OHDP::Endpoint & | dst, | ||
MemoryReference | payload | ||
) | [private] |
References Sirikata::DataReference< T >::data(), Sirikata::Logging::detailed, Sirikata::Logging::error, LOG_INVALID_MESSAGE_BUFFER, mContext, mPort, Sirikata::OHDP::Endpoint::node(), Sirikata::XDP::Port< EndpointType >::send(), Sirikata::serializePBJMessage(), SILOG, Sirikata::Context::simTime(), and Sirikata::DataReference< T >::size().
Referenced by TimeSyncServer().
Context* Sirikata::TimeSyncServer::mContext [private] |
Referenced by handleMessage().
OHDP::Port* Sirikata::TimeSyncServer::mPort [private] |
Referenced by handleMessage(), TimeSyncServer(), and ~TimeSyncServer().