|
LRAUV
revA
|
Combines a EnvSimulator with a SocketServer to provide
either remote, or out-of-process simulation. More...
#include <SimDaemon.h>

Public Member Functions | |
| SimDaemon (bool debug) | |
| virtual | ~SimDaemon () |
| void | run () throw ( SocketException& ) |
Static Public Member Functions | |
| static void | Daemonize (bool hideOutputs) |
| Code borrowed from http://www-theorie.physik.unizh.ch/~dpotter/howto/daemonize. More... | |
Static Public Attributes | |
| static const int | SOCKET_SERVER_PORT = SIMPORT |
Private Member Functions | |
| SimDaemon (const SimDaemon &old) | |
Static Private Member Functions | |
| static void * | ServiceClient (void *clientSocketPtr) |
Private Attributes | |
| SocketServer * | socketServer_ |
Static Private Attributes | |
| static bool | Debug_ |
| static bool | Shutdown_ |
| static Mutex | ShutdownMutex_ |
| static FastMap< uint64_t, EnvSimulator * > | SimulatorMap_ |
Combines a EnvSimulator with a SocketServer to provide
either remote, or out-of-process simulation.
Should be run as a daemon.
| SimDaemon::SimDaemon | ( | bool | debug | ) |
References Debug_.
|
virtual |
References FastMap< S, T >::getIndexed(), ShutdownMutex_, SimulatorMap_, and FastMap< S, T >::size().
|
private |
|
static |
Code borrowed from http://www-theorie.physik.unizh.ch/~dpotter/howto/daemonize.
To properly daemonize, the following steps must be followed.
Failure to do any of these steps will lead to a daemon process that can misbehave. The typical symptoms are as follows.
References EXIT_FAILURE, and EXIT_SUCCESS.
Referenced by main().
| void SimDaemon::run | ( | void | ) | ||
| throw | ( | SocketException & | |||
| ) | |||||
References SocketServer::accept(), ServiceClient(), Shutdown_, SOCKET_SERVER_PORT, and SocketException::what().
Referenced by main().
|
staticprivate |
References Socket::close(), Debug_, FastMap< S, T >::get(), SimInitStruct::initHeading_, Simulator::initialize(), SimInitStruct::initLat_, SimInitStruct::initLon_, SimInitStruct::initP_, SimInitStruct::initPitch_, SimInitStruct::initQ_, SimInitStruct::initR_, SimInitStruct::initRoll_, SimInitStruct::initU_, SimInitStruct::initV_, SimInitStruct::initW_, SimInitStruct::initZ_, MAX_DATA_LENGTH, FastMap< S, T >::pop(), FastMap< S, T >::put(), Socket::recv(), Simulator::run(), Socket::send(), Socket::setTimeout(), Shutdown_, SimHeadStruct::SIM_INIT_STRUCT, SimHeadStruct::SIM_QUIT, SimHeadStruct::SIM_REINIT_STRUCT, SimHeadStruct::SIM_RUN_STRUCT, SimulatorMap_, SimHeadStruct::structSize_, SimHeadStruct::structType_, SimHeadStruct::uuid_, and SocketException::what().
Referenced by run().
|
staticprivate |
Referenced by ServiceClient(), and SimDaemon().
|
staticprivate |
Referenced by run(), and ServiceClient().
|
staticprivate |
Referenced by ~SimDaemon().
|
staticprivate |
Referenced by ServiceClient(), and ~SimDaemon().
|
private |