AURobotServers
4
|
#include <ucmdexe.h>
Public Member Functions | |
bool | addFunction (UFunctionBase *function) |
bool | addNewRessources (UFunctionBase *function) |
bool | addResource (UResBase *res, UFunctionBase *owner) |
void | closeClient (int clientIdx) |
void | createBaseVar () |
bool | deleteFunction (UFunctionBase *function) |
bool | doBashCmd (UServerInMsg *msg, const char *cmdStr) |
execute a command line command and return reply as help text. More... | |
bool | executeFunction (int functionIndex, UServerInMsg *msg, void *extra, bool aPush) |
bool | executePushFunction (int functionIndex, UServerInMsg *msg, void *extra) |
bool | executeScriptFile (const char *cfn, bool andWait, int forClient) |
int | findFunctionIndex (UFunctionBase *function) |
int | findFunctionOwner (const char *tagName) |
int | getFuncCnt () |
double | getLoad () |
void * | getLoadedModuleRef (int functionIndex) |
virtual bool | getStaticHelpList (char *list, const int listCnt) |
UResBase * | getStaticResource (const char *resName, bool mayCreate, bool staticOnly=true) |
get a pointer to a static resource. More... | |
bool | handleAlive (UServerInMsg *msg) |
handles a command starting with the keyword 'alive'. More... | |
bool | handleMessagesThreadStart () |
bool | handleOneMessageFromQueue () |
bool | handleOneServerPushMessage () |
bool | handleShellCmd (UServerInMsg *msg) |
handles a command starting with the keyword 'do'. More... | |
bool | isClientAlive (int clientIdx, double holdOffTime) |
bool | isModuleStatic (int moduleIndex) |
Test if the module with this index is loaded as static. More... | |
bool | isResourceOwner (const char *ressID, UFunctionBase *owner) |
bool | isRxQueueEmpty () |
bool | isRxQueueFull () |
bool | isStopping () |
void | killServer (UServerInMsg *msg) |
UFunctionBase * | loadFunctionModule (const char *moduleFileName, char *buff, int buffCnt, const char *aliasName) |
virtual bool | loadStaticModule (const char *moduleName, const char *aliasName, char *why, const int whyCnt) |
virtual bool | methodCall (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct=NULL, int *returnStructCnt=NULL) |
bool | postCommand (int client, const char *command) |
void | print (const char *preStr) |
void | printRess (const char *preStr) |
void | run () |
void | runIdle () |
bool | sendDebug (UServerInMsg *msg, const char *debugText) |
bool | sendError (UServerInMsg *msg, const char *errorText) |
bool | sendHelp (UServerInMsg *msg, const char *infoText) |
bool | sendHelpDone (UServerInMsg *msg) |
Send a help close tag The help close tag </help> if followed by a full tag with the message 'msg' tag name and the text "info=done". More... | |
bool | sendHelpStart (UServerInMsg *msg, const char *infoText) |
Send the open help tag Send open tag with one 'info' attribute with the provided string as value. Must be finished with a call to sendHelpDone(msg). More... | |
bool | sendInfo (UServerInMsg *msg, const char *infoText) |
bool | sendMsg (int clientIdx, const char *message, int size) |
bool | sendMsg (UServerInMsg *msg, const char *message, int size) |
bool | sendMsg (int clientIdx, const char *message) |
bool | sendMsg (UServerInMsg *msg, const char *message) |
bool | sendMsgAll (const char *message, bool lockedUser) |
bool | sendText (UServerInMsg *msg, const char *text) |
bool | sendWarning (UServerInMsg *msg, const char *warningText) |
void | setName (const char *serverName) |
void | setServer (UServerPort *socketServer) |
void | setVerbose (bool value) |
void | stop (bool andWait) |
UCmdExe () | |
void | UCmdExeInit () |
bool | unloadAllModules () |
bool | unloadFunctionModule (const char *value) |
void | updateLocalVar () |
virtual | ~UCmdExe () |
Public Member Functions inherited from UResVarPool | |
int | addMethod (const char *formalName, const char *paramTypes, const char *comment) |
int | addMethodV (const char *formalName, const char *paramTypes, const char *comment) |
UVarPool * | addStruct (const char *name, const char *comment, bool copy=false) |
UVariable * | addVar (const char *name, const double initialValue, const char *type, const char *comment) |
UVariable * | addVar (const char *name, const char *initialValue, const char *type, const char *comment) |
UVariable * | addVarA (const char *name, const char *initialValue, const char *type, const char *comment) |
bool | callGlobal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt) |
bool | callGlobalV (const char *name, const char *paramOrder, UVariable **params, UDataBase **returnStruct, int *returnStructCnt) |
Call a method from the root var pool scope It may be in the structure direct (no '.') or in any sub-structure that the 'name.subname' indicate. More... | |
bool | callLocal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt) |
bool | callVS (const char *function, const char *stringParam) |
int | callVSCD (const char *function, const char *strPar, UDataBase *data, int cooSys) |
void | createBaseVar () |
virtual bool | createVarSpace (const int varCnt, const int structCnt, const int methCnt, const char *note, bool copy=false) |
bool | getGlobalString (const char *name, const char **value) |
bool | getGlobalValue (const char *name, double *value) |
bool | getGlobalValue (const char *name, const char **value) |
bool | getGlobalValue (const char *name, bool *value) |
bool | getGlobalValue (const char *name, UTime *value) |
bool | getLocalValue (const char *name, double *value) |
get a value in this variable tree More... | |
bool | getLocalValue (const char *name, bool *value) |
bool | getLocalValue (const char *name, UTime *value) |
double | getLocalValue (int idx) |
UPosition | getLocalValue3D (int idx) |
UPosRot | getLocalValue6D (int idx) |
bool | getLocalValueBool (int idx) |
int | getLocalValueInt (int idx) |
UTime | getLocalValueTime (int idx) |
const char * | getLogFileName () |
const char * | getVarDescription (int idx) |
UVarCalc * | getVarPool () |
virtual bool | gotAllResources (char *missingThese, int missingTheseCnt) |
bool | isLogFileOpen () |
bool | isLogFileOpen (const char *structName) |
bool | isVarPoolUpdated (int lastCnt, int *newCnt) |
void | logFileClose () |
bool | logFileOpen () |
void | logFileStart (const char *structName, bool open) |
virtual const char * | print (const char *preString, char *buff, int buffCnt) |
bool | setGlobalVar (const char *name, const double value, bool mayAdd) |
Assigns a value to a variable. The variable may be a part of a structure. More... | |
bool | setLocalVar (int idx, double value, const int element) |
bool | setLocalVar (const char *name, const double value, bool mayAdd) |
Assigns a value to a variable. The variable may be a part of a structure. More... | |
bool | setLocalVar3D (int idx, UPosition *value) |
bool | setLocalVar6D (int idx, UPosRot *value) |
bool | setLocalVarAdd (int idx, double value, const int element) |
bool | setLocalVarPose (int idx, UPose *value) |
virtual bool | setResource (UResBase *resource, bool remove) |
void | setVarPool (UVarCalc *sharedVarPool) |
int | updateQTvars (int structIdx) |
UResVarPool () | |
virtual | ~UResVarPool () |
Public Member Functions inherited from UResBase | |
void | createReplayVar (UVarPool *pool) |
virtual void | createResources () |
UCmdExe * | getCorePointer () |
char * | getLogFileName (char *fn, const int fnCnt) |
int | getResFuncIdx () |
const char * | getResID () |
int | getResVersion () |
bool | isA (const char *idStr) |
bool | isAlsoA (const char *id) |
virtual void | saveSettings () |
void | setCorePointer (UCmdExe *serverCore) |
void | setResFuncIdx (int idx) |
virtual void | setResID (const char *id, const int version) |
virtual void | updateReplayStatus () |
UResBase () | |
virtual | ~UResBase () |
Public Member Functions inherited from UReplay | |
void | addChild (UReplay *child) |
virtual bool | decodeReplayLine (char *) |
char * | getLogFileName (char *fn, const int fnCnt) |
char * | getReplayFileName (char *fn, const int fnCnt) |
int | getReplayLogLine () |
bool | isReplay () |
bool | isReplayFileOpen () |
void | removeChild (UReplay *child) |
virtual void | replayAdvanceTime (UTime untilTime) |
void | replaySetBaseFileName (const char *name, const char *preName="") |
void | replaySetFileName (const char *name) |
virtual bool | replayStep () |
int | replayStep (int steps) |
virtual bool | replayToTime (UTime untilTime) |
void | setParent (UReplay *parent) |
bool | setReplay (bool value) |
UReplay () | |
virtual | ~UReplay () |
Public Member Functions inherited from ULock | |
bool | lock () |
void | lockInit () |
void | post () |
bool | tryLock () |
bool | tryWait () |
ULock () | |
void | unlock () |
bool | wait () |
~ULock () | |
Public Member Functions inherited from UVarMethodImplement | |
virtual bool | methodCallV (const char *name, const char *paramOrder, UVariable *params[], UDataBase **returnStruct, int *returnStructCnt) |
virtual | ~UVarMethodImplement () |
Public Member Functions inherited from UServerPushImplement | |
bool | addPushWatch (UServerPush *obj) |
Add an server push object to watch list. This is called by a combined resource-push object when the object is updated and thus a push command may need triggering. More... | |
void | event () |
int | getFunctionOwner (UServerInMsg *msg) |
UServerPushImplement () | |
virtual | ~UServerPushImplement () |
Static Public Member Functions | |
static const char * | getResClassID () |
Static Public Member Functions inherited from UResVarPool | |
static const char * | getResClassID () |
Protected Member Functions | |
void | closeLogServer () |
virtual const char * | commandList () |
bool | handleQuit (UServerInMsg *msg) |
bool | handleServerCommand (UServerInMsg *msg) |
bool | handleServerPushCommand (UServerInMsg *msg) |
virtual const char * | name () |
void | resourcesUpdate (int funcIdx) |
void | resourcesUpdated () |
bool | sysModuleCmd (UServerInMsg *msg) |
bool | sysServerHelp (UServerInMsg *msg) |
bool | systemFunction (UServerInMsg *msg) |
bool | unloadThisModule (int funcIdx) |
Protected Member Functions inherited from UResVarPool | |
void | setDescription (const char *note, bool copy=false) |
Protected Member Functions inherited from UResBase | |
UResBase * | getStaticResource (const char *resName, bool mayCreate, bool staticOnly=true) |
get a pointer to a static resource. More... | |
Private Attributes | |
bool | callNotice |
should calls to plug-in functions be echo'ed to console (with time info) More... | |
char | currentMessage [MMS] |
UFunctionBase * | func [MAX_FUNCTION_COUNT] |
int | funcCnt |
int | idleLoopCnt |
UTime | idleStart |
start time for idle More... | |
double | idleTime |
seconds in idle state More... | |
bool | isIdle |
flag is true, when main thread is idle More... | |
ULogFile | logServer |
UServerPushQueue | push |
UResPool * | resPool |
UServerPort * | server |
const char * | servName |
bool | stopping |
pthread_t | threadHandle |
bool | threadRunning |
bool | threadStop |
UVariable * | varAlivePunkTime |
time to wait before punking silent clients More... | |
UVariable * | varAllowConnection |
pointer to allowConnection plag More... | |
UVariable * | varClients |
number of active clients More... | |
UVariable * | varIdle |
estimated load of server main thread More... | |
UVariable * | varLastClient |
number of last client connected More... | |
UVariable * | varLastClientSerial |
number of clients ever connected in this session More... | |
UVariable * | varOpen4connections |
is server open for connections More... | |
UVariable * | varPort |
port number for server More... | |
UVariable * | varQTvarUpdate |
time between update tests to QT gui More... | |
UVariable * | varTime |
pointer to allowConnection plag More... | |
bool | verboseMessages |
double | wakeupSec |
time to wait before main thread i woken (to test for e.g. timed events) More... | |
double | wLoad |
Static Private Attributes | |
static const int | MMS = MAX_MESSAGE_LENGTH_TO_CAM |
Additional Inherited Members | |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
Protected Attributes inherited from UResBase | |
int | resFuncIdx |
char | resID [MAX_RESOURCE_ID_LENGTH] |
char | resIsAlso [MAX_RESOURCE_ISALSO_LENGTH] |
int | resVersion |
Protected Attributes inherited from UReplay | |
bool | replay |
FILE * | replayFile |
char | replayFileName [REPLAY_FILE_NAME_LENGTH] |
replay filename More... | |
char | replayLine [MAX_LOG_LINE_LENGTH] |
int | replayLogLine |
UReplay * | replayParent |
UTime | replayTimeNext |
Protected Attributes inherited from UServerPushImplement | |
sem_t | actionFlag |
flag to be posted, when an event has happend More... | |
UServerPush * | pushWatch [MAX_PUSH_WATCH_CNT] |
int | pushWatchCnt |
ULock | pushWatchLock |
Static Protected Attributes inherited from UReplay | |
static const int | MAX_LOG_LINE_LENGTH = 10000 |
static const int | REPLAY_FILE_NAME_LENGTH = 264 |
max length of replay filename More... | |
Reads receive queue and asks loaded functions to handle command.
|
inline |
Constructor
References getResClassID(), UResBase::setResID(), UCmdExeInit(), and ~UCmdExe().
|
virtual |
bool UCmdExe::addFunction | ( | UFunctionBase * | function | ) |
Add one function object to server capabilities true if added (false if no more space).
References addNewRessources(), findFunctionOwner(), func, funcCnt, MAX_FUNCTION_COUNT, maxi(), UFunctionBase::name(), and resourcesUpdate().
Referenced by getResClassID(), loadFunctionModule(), UServerStatic::loadStaticModule(), loadStaticModule(), runCameraServerComponent(), and testServerGen().
bool UCmdExe::addNewRessources | ( | UFunctionBase * | function | ) |
Add any new ressources this function has to offer
References addResource(), findFunctionIndex(), UResPool::getResCnt(), UResPool::getResource(), isAlphaNum(), resourcesUpdated(), and resPool.
Referenced by addFunction(), and getResClassID().
bool UCmdExe::addResource | ( | UResBase * | res, |
UFunctionBase * | owner | ||
) |
Add one resource into the resource structure with this owner module.
res | resource that should be added into resource pool |
owner | the owner module that just created the resource true if added (false if no more space). |
References UResPool::addResource(), UResBase::createResources(), findFunctionIndex(), UResBase::getResID(), UFunctionBase::name(), resourcesUpdated(), resPool, UResBase::setCorePointer(), and UResBase::setResFuncIdx().
Referenced by addNewRessources(), UFunctionBase::addResource(), and getResClassID().
void UCmdExe::closeClient | ( | int | clientIdx | ) |
Shut down a connection to a client
References UServerPort::getClient(), UServerPort::getServerNamespace(), server, and UServerClient::stopConnection().
Referenced by getResClassID(), and systemFunction().
|
protected |
Close log for all server commands
References ULogFile::closeLog(), and logServer.
Referenced by getLoad().
|
protectedvirtual |
a stringlist of tag-names handled by system. e.g. "sys sysHigh system" that will handle all tags of this type.
Referenced by findFunctionOwner(), getLoad(), sysModuleCmd(), and sysServerHelp().
void UCmdExe::createBaseVar | ( | ) |
Create basic core variables and functions
References UResVarPool::addMethod(), UResVarPool::addVar(), UResVarPool::addVarA(), UResBase::getResVersion(), varAlivePunkTime, varAllowConnection, varClients, varIdle, varLastClient, varLastClientSerial, varOpen4connections, varPort, varQTvarUpdate, and varTime.
Referenced by getFuncCnt(), and UCmdExeInit().
bool UCmdExe::deleteFunction | ( | UFunctionBase * | function | ) |
Remove function from server function list. (This does not delete the function object). Returns true if function is found.
References func, funcCnt, UResPool::getResCnt(), UResBase::getResID(), UResPool::getResource(), UResPool::removeResourceFunc(), UFunctionBase::resourceUpdated(), resPool, server, UFunctionBase::setResource(), UResBase::setResource(), and UServerPort::setResource().
Referenced by getResClassID(), and unloadThisModule().
bool UCmdExe::doBashCmd | ( | UServerInMsg * | msg, |
const char * | cmdStr | ||
) |
execute a command line command and return reply as help text.
msg | The source command |
cmdStr | the command that should be send to the system The function uses popen to start the commands and continues to read from the stream until it terminates. |
References sendHelpDone(), sendHelpStart(), and sendText().
Referenced by getLoad(), and handleShellCmd().
bool UCmdExe::executeFunction | ( | int | functionIndex, |
UServerInMsg * | msg, | ||
void * | extra, | ||
bool | aPush | ||
) |
Execute one of the functions with this command message. The 'extra' parameter is intended for event triggered push-commands, where the object triggering the event can be transferred as the extra parameter.
functionIndex | the index returned by findFunctionOwner(tagName) |
msg | The XMK reading structure with the command. |
extra | may be a pointer to a relevant object (laserscan, imega or other object usable by the function) |
aPush | set to true if this is a push command (to allow better logging etc) true if the functione were successfully executed. |
References bool2str(), callNotice, UServerInMsg::client, func, UServerPort::getClient(), ULogFile::getF(), UTime::getMicrosec(), UMsgQueue::getNextOut(), UServerPort::getRxQueue(), UTime::getSec(), USmlTagIn::getTagName(), UTime::getTimePassed(), UMsgQueue::getUsedMsgCnt(), UServerClient::isActive(), UFunctionBase::isMine(), ULogFile::isOpen(), UServerClient::lock(), logServer, MAX_FUNCTION_COUNT, UServerInMsg::message, UFunctionBase::newCommand(), UTime::now(), server, systemFunction(), UServerInMsg::tag, and UServerClient::unlock().
Referenced by executePushFunction(), handleOneMessageFromQueue(), isStopping(), and UPush::pushEvent().
|
virtual |
Ececute a push function, and lock for dynamic load/unload of function during operation.
functionIndex | the index returned by findFunctionOwner(tagName) |
msg | The XMK reading structure with the command. |
extra | may be a pointer to a relevant object (laserscan, imega or other object usable by the function) |
Reimplemented from UServerPushImplement.
References executeFunction(), ULock::lock(), and ULock::unlock().
Referenced by isStopping().
bool UCmdExe::executeScriptFile | ( | const char * | cfn, |
bool | andWait, | ||
int | forClient | ||
) |
Execute a scriptfile of commands. The filename 'cfn' is assumed to be on the dataPath, unless the initial character of the name is '.' or '/'. Each command is put on the RX-queue if the queue is empty. If the queue is not empty the sequence is stalled until the queue is empty. If andWait is false, the commands are put on queue until no more commands or the queue is full. The command reply is returned to the client 'forClient'. If client is -1, then output to console (and push commands are not valid). true if all commands are put on queue.
References isRxQueueEmpty(), isRxQueueFull(), UResBase::line, postCommand(), sendMsg(), verboseMessages, and Wait().
Referenced by getFuncCnt(), handleServerCommand(), runCameraServerComponent(), runLaserServerComponent(), and runServer().
int UCmdExe::findFunctionIndex | ( | UFunctionBase * | function | ) |
Find the index of this function - start from the latest (highest number) to allocate new resources to the most likely owner. Returns -1 if no index were found, otherwise an index from 0 to MAX_FUNCTION_COUNT
Referenced by addNewRessources(), addResource(), and isStopping().
|
virtual |
Find function owner (index into list) for this tag name (command keyword) Returns MAX_FUNCTION_COUNT if it is a system function keyword. Returns -1 if keyword is not found.
Reimplemented from UServerPushImplement.
References commandList(), func, funcCnt, inThisStringList(), and MAX_FUNCTION_COUNT.
Referenced by addFunction(), and isStopping().
|
inline |
Get number of server function modules. This excludes the server function itself.
References createBaseVar(), executeScriptFile(), funcCnt, getStaticHelpList(), isResourceOwner(), isRxQueueEmpty(), isRxQueueFull(), loadFunctionModule(), loadStaticModule(), methodCall(), name(), postCommand(), sendText(), unloadAllModules(), unloadFunctionModule(), and updateLocalVar().
Referenced by sysServerHelp().
|
inline |
Get load figure. Load is calculated as the number of idle waits in a fixed number of seconds. Result is in the range [1.0 to 0.0].
References closeLogServer(), commandList(), doBashCmd(), getStaticResource(), handleAlive(), handleQuit(), handleServerCommand(), handleServerPushCommand(), handleShellCmd(), isModuleStatic(), killServer(), name(), resourcesUpdate(), resourcesUpdated(), sysModuleCmd(), sysServerHelp(), systemFunction(), unloadThisModule(), and wLoad.
Referenced by handleServerCommand().
void * UCmdExe::getLoadedModuleRef | ( | int | functionIndex | ) |
Get handle to loaded module (for further symbol references
References func, funcCnt, and UFunctionBase::getLoadedModuleRef().
Referenced by isStopping(), unloadFunctionModule(), and unloadThisModule().
|
inlinestatic |
Fixed name of this resource type
References addFunction(), addNewRessources(), addResource(), closeClient(), deleteFunction(), handleOneMessageFromQueue(), handleOneServerPushMessage(), print(), sendMsg(), sendMsgAll(), and setName().
Referenced by UResPoseHist::gotAllResources(), UImagePool::gotAllResources(), ULaserPool::gotAllResources(), UResVarPool::gotAllResources(), UCamPool::gotAllResources(), UFunctionBase::gotAllResources(), UResPool::print(), UResIf::setResource(), ULaserPool::setResource(), UResPoseHist::setResource(), UFunctionBase::setResource(), UResCamIf::setResource(), UResLaserIf::setResource(), UImagePool::setResource(), UResSmrIf::setResource(), UServerPort::setResource(), UCamPool::setResource(), and UCmdExe().
|
virtual |
Get help text for available static modules
Reimplemented in UServerStatic, UServerStatic, UServerStatic, UServerStatic, UServerStatic, UServerStatic, and UServerStatic.
Referenced by getFuncCnt(), UServerStatic::getStaticHelpList(), and sysModuleCmd().
|
virtual |
get a pointer to a static resource.
resName | The name of the resource to be acquired. |
mayCreate | if set to true, then the resource will be created if it do not exist. |
staticOnly | get only if a static resource (default). Getting non-static resources may be dangerous of not within same plugin, if not compiled against the same source (headerfilles). |
Reimplemented from UServerPushImplement.
References UResBase::getResFuncIdx(), UResPool::getResource(), isModuleStatic(), loadStaticModule(), and resPool.
Referenced by getLoad(), UResBase::getStaticResource(), UFunctionBase::getStaticResource(), run(), and MainWindow::updateImg().
bool UCmdExe::handleAlive | ( | UServerInMsg * | msg | ) |
handles a command starting with the keyword 'alive'.
msg | The source command |
References USmlTagIn::getAttValue(), USmlTagIn::getTagName(), sendHelpDone(), sendHelpStart(), sendMsg(), sendText(), server, UServerPort::serverAliveLast(), and UServerInMsg::tag.
Referenced by getLoad(), and systemFunction().
bool UCmdExe::handleMessagesThreadStart | ( | ) |
Start theeage handling thread
References callRunIdle(), handleMessagesThreadCall(), threadHandle, threadRunning, and threadStop.
Referenced by runCameraServerComponent(), runLaserServerComponent(), runServer(), setVerbose(), and testServerGen().
bool UCmdExe::handleOneMessageFromQueue | ( | ) |
Handle next message in queue, and return true if a message were handled. if no message is available then return false.
References UServerInMsg::client, currentMessage, executeFunction(), ULogFile::getF(), UServerPushImplement::getFunctionOwner(), UTime::getMicrosec(), UMsgQueue::getNextOut(), UServerPort::getRxQueue(), UTime::getSec(), UTime::getTimePassed(), UMsgQueue::getUsedMsgCnt(), ULogFile::isOpen(), ULock::lock(), logServer, UServerInMsg::message, MMS, UTime::now(), UServerInMsg::print(), sendWarning(), server, UServerInQueue::skipToNextMessage(), threadStop, ULock::unlock(), and verboseMessages.
Referenced by getResClassID(), and run().
bool UCmdExe::handleOneServerPushMessage | ( | ) |
Test the server push queue for pending executions. Start with the next after last test.
References UServerPushElement::activeCall, UServerPushElement::activeCmd, bool2str(), UServerInMsg::client, UServerPushQueue::doPushCall(), func, UServerPushElement::functionIndex, ULogFile::getF(), UTime::getMicrosec(), UMsgQueue::getNextOut(), UServerPushQueue::getNextTimedPushElement(), UServerPort::getRxQueue(), UTime::getSec(), UTime::getTimePassed(), UMsgQueue::getUsedMsgCnt(), UResVarPool::getVarPool(), isClientAlive(), ULogFile::isOpen(), ULock::lock(), logServer, MAX_FUNCTION_COUNT, UServerInMsg::message, UFunctionBase::newCommand(), UTime::now(), push, server, systemFunction(), UServerPushElement::toDo, ULock::unlock(), and UServerPushElement::update().
Referenced by getResClassID(), and run().
|
protected |
handle the quit command - from any client
msg | is the reference to the client that send the command, and possibly expects a reply |
References USmlTagIn::getAttValue(), killServer(), sendHelpDone(), sendHelpStart(), sendText(), servName, and UServerInMsg::tag.
Referenced by getLoad(), and systemFunction().
|
protected |
System wide command
References appName, bool2str(), callNotice, UServerInMsg::client, ULogFile::closeLog(), dataPath, executeScriptFile(), UServerPort::getActiveClientCnt(), USmlTagIn::getAttValue(), UServerPort::getClient(), UServerPort::getClientCnt(), UServerClient::getClientName(), UTime::GetDateString(), ULogFile::getF(), getLoad(), ULogFile::getLogFileName(), UServerClient::getLogFilename(), UServerClient::getLogReply(), UServerClient::getLogTimestamp(), UTime::getMicrosec(), UServerClient::getNamespaceTag(), USmlTagIn::getNextAttribute(), UMsgQueue::getNextOut(), UServerPort::getPort(), UServerPort::getRxQueue(), UTime::getSec(), UServerPort::getServerNamespace(), USmlTagIn::getTagName(), UTime::getTimeAsString(), UMsgQueue::getUsedMsgCnt(), imagePath, UServerClient::isActive(), UServerClient::isLogOpen(), ULogFile::isOpen(), UServerPort::isOpen4Connections(), killServer(), UServerInQueue::list(), UServerClient::logClose(), UServerClient::logOpen(), logServer, MAX_PATH_LENGTH, MAX_SML_NAME_LENGTH, name(), UTime::Now(), ULogFile::openLog(), UReplay::replayAdvanceTime(), replayPath, UReplay::replayTimeNow, sendHelp(), sendHelpDone(), sendHelpStart(), sendInfo(), sendMsg(), sendText(), sendWarning(), server, serverPort, servName, ULogFile::setLogName(), UServerClient::setLogReply(), UServerClient::setLogTimestamp(), UServerPort::setPort(), UTime::setTimeTod(), UServerPort::setVerbose(), str2bool(), str2bool2(), UServerInMsg::tag, verboseMessages, and Wait().
Referenced by getLoad(), and systemFunction().
|
protected |
This message is to be handled as a server push queue command
References UServerPushElement::activeCall, UServerPushElement::activeCmd, bool2str(), UServerPushElement::clear(), UServerInMsg::client, UServerPushElement::countGoodTarget, UServerPushElement::countTotalTarget, UServerPushElement::functionIndex, UServerPushQueue::getFreeQueueElement(), UServerPushImplement::getFunctionOwner(), USmlTagIn::getNextAttribute(), USmlTagIn::getTagName(), UServerPushElement::interval, MAX_MESSAGE_LENGTH_TO_CAM, MAX_SML_NAME_LENGTH, UServerPushElement::nextExeTime, UTime::Now(), UServerPushQueue::print(), push, sendInfo(), sendMsg(), sendText(), sendWarning(), UServerInMsg::serverPushCommand, UServerPushElement::setCall(), UServerInMsg::setMessage(), UServerPushQueue::systemQueueflush(), UServerInMsg::tag, UServerPushElement::toDo, and wakeupSec.
Referenced by getLoad(), and systemFunction().
bool UCmdExe::handleShellCmd | ( | UServerInMsg * | msg | ) |
handles a command starting with the keyword 'do'.
msg | The source command |
References doBashCmd(), USmlTagIn::getAttValue(), USmlTagIn::getNext(), USmlTagIn::reset(), sendHelpDone(), sendHelpStart(), sendText(), UServerInMsg::tag, and xml2str().
Referenced by getLoad(), and systemFunction().
|
virtual |
Test to see if client is alive
clientIdx | is client number (between 0 and 19) |
holdOffTime | is hold off time after connection. |
Reimplemented from UServerPushImplement.
References UServerClient::connectTime, UServerPort::getClient(), UTime::getTimePassed(), UServerClient::isActive(), and server.
Referenced by handleOneServerPushMessage(), UFunctionBase::isClientAlive(), isStopping(), and UPush::pushEvent().
bool UCmdExe::isModuleStatic | ( | int | moduleIndex | ) |
Test if the module with this index is loaded as static.
References func, funcCnt, and UFunctionBase::isStatic().
Referenced by getLoad(), and getStaticResource().
bool UCmdExe::isResourceOwner | ( | const char * | ressID, |
UFunctionBase * | owner | ||
) |
Is this function owner of this resource
References func, UResBase::getResFuncIdx(), UResPool::getResource(), and resPool.
Referenced by getFuncCnt().
bool UCmdExe::isRxQueueEmpty | ( | ) |
true if commandqueue is empty
References UServerPort::getRxQueue(), UMsgQueue::isEmpty(), and server.
Referenced by executeScriptFile(), and getFuncCnt().
bool UCmdExe::isRxQueueFull | ( | ) |
Is receive queue full, i.e. no more space to pose commands. true if queue is full.
References UServerPort::getRxQueue(), UMsgQueue::isFull(), and server.
Referenced by executeScriptFile(), and getFuncCnt().
|
inline |
Is the server in the process of stopping all threads
References executeFunction(), executePushFunction(), findFunctionIndex(), findFunctionOwner(), getLoadedModuleRef(), isClientAlive(), and stopping.
Referenced by shutDownHandler().
void UCmdExe::killServer | ( | UServerInMsg * | msg | ) |
Send a kill signal to server process.
msg | optional reference to the client that ordered the kill |
References UServerInMsg::client, ULogFile::getF(), UTime::getMicrosec(), UTime::getSec(), ULogFile::isOpen(), logServer, UTime::now(), and sendInfo().
Referenced by getLoad(), handleQuit(), and handleServerCommand().
UFunctionBase * UCmdExe::loadFunctionModule | ( | const char * | moduleFileName, |
char * | buff, | ||
int | buffCnt, | ||
const char * | aliasName | ||
) |
Load a plugin module with this qualified filename. Filename is typically of the form './name.so.0'. Returns pointer to created function if loaded. Returns NULL if load failed. The loaded module is added to the function list. The function try to load the module static first, if this fails the module name is assumed to be a filename and attempts to load it as a plugin. The returned handle can be used to make some static initialization if needed. A number of error messages may be send to 'stderr' and stored in 'buff' if the load fails.
References addFunction(), func, UTime::now(), UFunctionBase::setAliasName(), UFunctionBase::setLoadedModuleRef(), and UFunctionBase::setLoadTime().
Referenced by getFuncCnt(), and sysModuleCmd().
|
virtual |
Create a function at a higher level, this is intended to be static available modules in specific servers. The moduleName is a keyword to one of the available static modules. If no such module exist a NULL pointer is returned. If the module exist, it should be created and added to the function list. A pointer to the created function should be returned, to allow further processing.
[in] | *moduleName | name of module, euther a filename or a name of a stativ module |
[in] | *aliasName | a specific (pre-) name to be used for command, resource and logfile. |
Reimplemented in UServerStatic, UServerStatic, UServerStatic, UServerStatic, UServerStatic, UServerStatic, and UServerStatic.
References addFunction(), UResPoseHist::getMapPoseID(), UResPoseHist::getOdoPoseID(), UResPoseHist::getUtmPoseID(), and UFunctionPoseHist::setAliasName().
Referenced by getFuncCnt(), getStaticResource(), UServerStatic::loadStaticModule(), and sysModuleCmd().
|
virtual |
Function to implement a var-pool method call. The function with 'name' and pameters in the order 'paramOrder' is to be called. The actual parameters are in 'strings' and 'doubles'. A double sized result may be returned in 'value'. May return struct values in the 'returnStruct' pointer list (when the pointer list is not NULL), and in this case the 'returnStructCnt' is set to the maximum number of pointers available and should be modified to the number of valid pointers returned. Should return true if function was handled. (otherwise an invalid function specification is assumed).
Reimplemented from UResVarPool.
References postCommand(), and roundi().
Referenced by getFuncCnt().
|
protectedvirtual |
Name and version of the command executor
References servName.
Referenced by getFuncCnt(), getLoad(), handleServerCommand(), and sysModuleCmd().
bool UCmdExe::postCommand | ( | int | client, |
const char * | command | ||
) |
Post command to command queue from string.
References UServerInQueue::addMessage(), UServerPushImplement::event(), UServerPort::getRxQueue(), logServer, UQevent::postedCommand(), qevent, server, and ULogFile::toLog().
Referenced by executeScriptFile(), getFuncCnt(), UResIfVar::handleVar(), methodCall(), MainWindow::queueMsg(), runCameraServerComponent(), runLaserServerComponent(), runServer(), runTerminal(), UResMapObst::sendMapLinesToLocalizer(), and testServerGen().
|
virtual |
Print status to console
Reimplemented from UResBase.
References currentMessage, idleLoopCnt, UServerPort::print(), UServerPushQueue::print(), push, and server.
Referenced by getResClassID(), runCameraServerComponent(), runLaserServerComponent(), runServer(), runTerminal(), and testServerGen().
|
inline |
Print resource status to console
References UResPool::print(), resPool, and setServer().
|
protected |
Update this function with the full resource list.
References func, UResPool::getResCnt(), UResPool::getResFunc(), UResPool::getResource(), UFunctionBase::resourceUpdated(), resPool, and UFunctionBase::setResource().
Referenced by addFunction(), getLoad(), and resourcesUpdated().
|
protected |
One or more resources are added or deleted - inform all other functions.
References funcCnt, UResPool::getResCnt(), UResPool::getResource(), resourcesUpdate(), resPool, server, UResBase::setResource(), and UServerPort::setResource().
Referenced by addNewRessources(), addResource(), and getLoad().
void UCmdExe::run | ( | ) |
Thread function that handles the messages. Stopped by setting threadStop to true. Test if running by inspecting threadRunning.
References UServerPushImplement::actionFlag, UVariable::getDouble(), getStaticResource(), UTime::getTimePassed(), UVariable::getValueBool(), handleOneMessageFromQueue(), handleOneServerPushMessage(), UResPool::handleReplay(), idleStart, idleTime, UResVarPool::isVarPoolUpdated(), ULock::lock(), UTime::now(), UServerPushImplement::pushWatch, UServerPushImplement::pushWatchCnt, UServerPushImplement::pushWatchLock, qevent, resPool, server, UServerPort::serverIsAlive(), UServerPort::setAllowConnections(), UVariable::setDouble(), threadRunning, threadStop, ULock::unlock(), updateLocalVar(), UResVarPool::updateQTvars(), varAllowConnection, varFastestUpdateTime, varIdle, varQTvarUpdate, and Wait().
Referenced by handleMessagesThreadCall(), and setVerbose().
void UCmdExe::runIdle | ( | ) |
wakes message thread regularly, when no activity Claculates load percentage
References UServerPushImplement::event(), threadStop, Wait(), and wakeupSec.
Referenced by callRunIdle(), and setVerbose().
bool UCmdExe::sendDebug | ( | UServerInMsg * | msg, |
const char * | debugText | ||
) |
Send a debug message to the client of with the tag type of the command, with a marking as a debug message and the provided warning text. the test will be put in double quotes, s� (almost) all characters are legal.
References UServerInMsg::client, USmlTagIn::getTagName(), sendMsg(), str2xml(), and UServerInMsg::tag.
Referenced by UFunctionBase::sendDebug(), and setVerbose().
bool UCmdExe::sendError | ( | UServerInMsg * | msg, |
const char * | errorText | ||
) |
Send an error to the client of with the tag type of the command, with a marking as an error and the provided error text. the text will be put in double quotes, and encoded with escape sequence as needed, s� (almost) all characters are legal.
References UServerInMsg::client, USmlTagIn::getTagName(), sendMsg(), str2xml(), and UServerInMsg::tag.
Referenced by UFunctionBase::sendError(), and setVerbose().
bool UCmdExe::sendHelp | ( | UServerInMsg * | msg, |
const char * | infoText | ||
) |
Send a info message to the client of with tag type help. The test will be put in double quotes and converted to XML-text.
References UServerInMsg::client, sendMsg(), and str2xml().
Referenced by handleServerCommand(), UFunctionBase::sendHelp(), and setVerbose().
bool UCmdExe::sendHelpDone | ( | UServerInMsg * | msg | ) |
Send a help close tag The help close tag </help> if followed by a full tag with the message 'msg' tag name and the text "info=done".
References UServerInMsg::client, sendInfo(), and sendMsg().
Referenced by doBashCmd(), handleAlive(), handleQuit(), handleServerCommand(), handleShellCmd(), UFunctionBase::sendHelpDone(), setVerbose(), and sysModuleCmd().
bool UCmdExe::sendHelpStart | ( | UServerInMsg * | msg, |
const char * | infoText | ||
) |
Send the open help tag Send open tag with one 'info' attribute with the provided string as value. Must be finished with a call to sendHelpDone(msg).
msg | The message with the client information. |
infoText | The string value to put into the info attribute. |
References UServerInMsg::client, sendMsg(), and str2xml().
Referenced by doBashCmd(), handleAlive(), handleQuit(), handleServerCommand(), handleShellCmd(), UFunctionBase::sendHelpStart(), and setVerbose().
bool UCmdExe::sendInfo | ( | UServerInMsg * | msg, |
const char * | infoText | ||
) |
Send a info message to the client of with the tag type of the command, with a marking as an info message and the provided text. the test will be put in double quotes, and converted to XML-text (i.e. using > for '>').
References UServerInMsg::client, USmlTagIn::getTagName(), sendMsg(), str2xml(), and UServerInMsg::tag.
Referenced by handleServerCommand(), handleServerPushCommand(), killServer(), sendHelpDone(), UFunctionBase::sendInfo(), setVerbose(), sysModuleCmd(), and sysServerHelp().
bool UCmdExe::sendMsg | ( | int | clientIdx, |
const char * | message, | ||
int | size | ||
) |
Send a message to a client or to console with fized length - message may include a zero character. Returns true if send. NB! this call is depricated, as it do not allow lock of client connection during af lengthy transmission!! Use sendMsg(UServerInMsg * msg, const char * message, int size) instead.
References UServerClient::blockSend(), UQevent::consoleReply(), UServerPort::getClient(), UServerClient::isActive(), mini(), qevent, server, and xml2str().
Referenced by executeScriptFile(), getResClassID(), handleAlive(), handleServerCommand(), handleServerPushCommand(), sendDebug(), sendError(), sendHelp(), sendHelpDone(), sendHelpStart(), sendInfo(), sendMsg(), UFunctionBase::sendMsg(), UFunctionBase::sendMsgInt(), USmlTag::sendProbPoly(), sendText(), UResRuleState::sendToClientAsHelp(), sendWarning(), sysModuleCmd(), and sysServerHelp().
bool UCmdExe::sendMsg | ( | UServerInMsg * | msg, |
const char * | message, | ||
int | size | ||
) |
Send a message to a client or to console with fized length - message may include a zero character. Returns true if send.
References UServerInMsg::client, and sendMsg().
bool UCmdExe::sendMsg | ( | int | clientIdx, |
const char * | message | ||
) |
Send zero terminated string. Returns true if send. NB! this call is depricated, as it do not allow lock of client connection during af lengthy transmission!! Use sendMsg(UServerInMsg * msg, const char * message.
References sendMsg().
bool UCmdExe::sendMsg | ( | UServerInMsg * | msg, |
const char * | message | ||
) |
bool UCmdExe::sendMsgAll | ( | const char * | message, |
bool | lockedUser | ||
) |
Send a message to all active clients. The connection is locked during the transmission, except for the user 'lockedUser', as it is assumed that the connection to this user is locked already (if called as part of a user request). If this function is not called as a direct reply to a user (client) request the 'lockedUsed' should be set to -1. Returns true if at least one client got the message.
References UServerClient::blockSend(), UServerPort::getClient(), UServerPort::getClientCnt(), UServerClient::isActive(), UServerClient::lock(), server, and UServerClient::unlock().
Referenced by getResClassID().
bool UCmdExe::sendText | ( | UServerInMsg * | msg, |
const char * | text | ||
) |
Send text string, and ensure that special protected XML characters are converted to an escape sequence, e.g. '<' = <. true if send.
References sendMsg(), and str2xmlMin().
Referenced by doBashCmd(), getFuncCnt(), handleAlive(), handleQuit(), handleServerCommand(), handleServerPushCommand(), handleShellCmd(), UFunctionBase::sendText(), sysModuleCmd(), and sysServerHelp().
bool UCmdExe::sendWarning | ( | UServerInMsg * | msg, |
const char * | warningText | ||
) |
Send a warning to the client of with the tag type of the command, with a marking as a warning and the provided warning text. the text will be put in double quotes, and encoded with escape sequence as needed, s� (almost) all characters are legal.
References UServerInMsg::client, USmlTagIn::getTagName(), sendMsg(), str2xml(), and UServerInMsg::tag.
Referenced by handleOneMessageFromQueue(), handleServerCommand(), handleServerPushCommand(), UFunctionBase::sendWarning(), setVerbose(), and sysModuleCmd().
void UCmdExe::setName | ( | const char * | serverName | ) |
Fixed varsion number for this resource type. Should follow release version, i.e. version 1.28 gives number 128. Should be incremented only when there is change to this class definition, i.e new or changed functions or variables. Set the name of the server
References servName.
Referenced by getResClassID(), runCameraServerComponent(), runLaserServerComponent(), runServer(), and testServerGen().
void UCmdExe::setServer | ( | UServerPort * | socketServer | ) |
Set socket server, from where to get the commands
References server, UServerPort::setResource(), updateLocalVar(), UServerPort::varAlivePunkTime, and varAlivePunkTime.
Referenced by printRess(), runCameraServerComponent(), runLaserServerComponent(), runServer(), and testServerGen().
|
inline |
Set verbose messages - mostly for debug purpose
References handleMessagesThreadStart(), run(), runIdle(), sendDebug(), sendError(), sendHelp(), sendHelpDone(), sendHelpStart(), sendInfo(), sendWarning(), stop(), and verboseMessages.
Referenced by runCameraServerComponent(), runLaserServerComponent(), runServer(), and testServerGen().
|
virtual |
Stop message handling thread, and wait for termination if the 'andWait' flag is true
Reimplemented from UResBase.
References UMsgQueue::clear(), UServerPort::getRxQueue(), server, UServerPort::stop(), stopping, threadHandle, threadRunning, threadStop, unloadAllModules(), and Wait().
Referenced by setVerbose(), shutDownHandler(), testServerGen(), and ~UCmdExe().
|
protected |
Handling module load, unload and list commands
References UVariable::add(), UResVarPool::addStruct(), UVarPool::addVar(), UVarPool::addVarA(), UServerInMsg::client, UFunctionBase::commandList(), commandList(), func, funcCnt, UFunctionBase::getAliasName(), UVariable::getInt(), UFunctionBase::getLoadedFileName(), UFunctionBase::getLoadedModuleRef(), UVarPool::getLocalVar(), UVarPool::getLocalVarIndex(), USmlTagIn::getNextAttribute(), getStaticHelpList(), UVarPool::getStruct(), USmlTagIn::getTagName(), UResVarPool::getVarPool(), USmlTagIn::isValid(), loadFunctionModule(), loadStaticModule(), UFunctionBase::MAX_ID_LENGTH, MAX_SML_NAME_LENGTH, UFunctionBase::name(), name(), UResPool::print(), UResBase::resID, resPool, sendHelpDone(), sendInfo(), sendMsg(), sendText(), sendWarning(), UServerInMsg::tag, and unloadFunctionModule().
Referenced by getLoad(), and systemFunction().
|
protected |
Send server general help back to client
References commandList(), func, funcCnt, getFuncCnt(), UServerPort::getHostName(), UServerPort::getPort(), UResPool::getResCnt(), resPool, sendInfo(), sendMsg(), sendText(), server, and servName.
Referenced by getLoad(), and systemFunction().
|
protected |
This is a system function command, deal with it. System functions are e.g. server pusk commands.
References UServerInMsg::client, closeClient(), USmlTagIn::getTagName(), handleAlive(), handleQuit(), handleServerCommand(), handleServerPushCommand(), handleShellCmd(), USmlTagIn::isTagA(), USmlTagIn::isValid(), sysModuleCmd(), sysServerHelp(), UServerInMsg::tag, and verboseMessages.
Referenced by executeFunction(), getLoad(), and handleOneServerPushMessage().
void UCmdExe::UCmdExeInit | ( | ) |
Initialization of server core
References UResPool::addResource(), callNotice, createBaseVar(), UResVarPool::createVarSpace(), funcCnt, idleLoopCnt, MAX_FUNCTION_COUNT, UServerPushImplement::pushWatchCnt, UResBase::resFuncIdx, resPool, server, servName, UResBase::setCorePointer(), UResVarPool::setResource(), stopping, threadRunning, threadStop, verboseMessages, and wakeupSec.
Referenced by UCmdExe().
bool UCmdExe::unloadAllModules | ( | ) |
Unload all modules - static as well as loaded - make an empty server
References funcCnt, resPool, UResPool::saveSettings(), UResPool::stop(), and unloadThisModule().
Referenced by getFuncCnt(), and stop().
bool UCmdExe::unloadFunctionModule | ( | const char * | value | ) |
Unload a loadable module with this name. The name should be unique among loaded modules, and must at least hold three character. Module may be identified by an integer value (from function list) or the first part of the module name (at least 3 characters). If more modeles match the name, then the last module with a match is unloaded. Returns true if a module is unloaded, or false if no loaded module matches the name. Static modules should not be unloaded (but may be overloaded).
References func, funcCnt, UFunctionBase::getAliasName(), UFunctionBase::getLoadedFileName(), getLoadedModuleRef(), UFunctionBase::name(), and unloadThisModule().
Referenced by getFuncCnt(), and sysModuleCmd().
|
protected |
Unload the module with this index number and any ressources owned by this module. The index may be a static (compiled in) module or a loaded module. Returns true if the module is removed.
References deleteFunction(), func, funcCnt, UFunctionBase::getLoadedFileName(), getLoadedModuleRef(), and UFunctionBase::name().
Referenced by getLoad(), unloadAllModules(), and unloadFunctionModule().
void UCmdExe::updateLocalVar | ( | ) |
Update local variables, e.g. clients, open, port
References UServerPort::getActiveClientCnt(), UServerPort::getLastClient(), UServerPort::getLastClientSerial(), UServerPort::getPort(), UServerPort::isOpen4Connections(), server, UVariable::setBool(), UVariable::setInt(), UVariable::setTimeNow(), varClients, varLastClient, varLastClientSerial, varOpen4connections, varPort, and varTime.
Referenced by getFuncCnt(), run(), and setServer().
|
private |
should calls to plug-in functions be echo'ed to console (with time info)
Referenced by executeFunction(), handleServerCommand(), and UCmdExeInit().
|
private |
Currentlt handling this message
Referenced by handleOneMessageFromQueue(), and print().
|
private |
Functions to handle the commands
Referenced by addFunction(), deleteFunction(), executeFunction(), findFunctionIndex(), findFunctionOwner(), getLoadedModuleRef(), handleOneServerPushMessage(), isModuleStatic(), isResourceOwner(), loadFunctionModule(), UServerStatic::loadStaticModule(), resourcesUpdate(), sysModuleCmd(), sysServerHelp(), unloadFunctionModule(), and unloadThisModule().
|
private |
Number of functions loaded
Referenced by addFunction(), deleteFunction(), findFunctionIndex(), findFunctionOwner(), getFuncCnt(), getLoadedModuleRef(), isModuleStatic(), resourcesUpdated(), sysModuleCmd(), sysServerHelp(), UCmdExeInit(), unloadAllModules(), unloadFunctionModule(), and unloadThisModule().
|
private |
Command idle loop count
Referenced by print(), and UCmdExeInit().
|
private |
seconds in idle state
Referenced by run().
|
private |
flag is true, when main thread is idle
|
private |
Logfile for server
Referenced by closeLogServer(), executeFunction(), handleOneMessageFromQueue(), handleOneServerPushMessage(), handleServerCommand(), killServer(), postCommand(), and ~UCmdExe().
|
staticprivate |
Max length of current handled message (saved part) (size 1000)
Referenced by handleOneMessageFromQueue().
|
private |
Server push queue
Referenced by handleOneServerPushMessage(), handleServerPushCommand(), and print().
|
private |
Pool of shared sresources
Referenced by addNewRessources(), addResource(), deleteFunction(), getStaticResource(), isResourceOwner(), printRess(), resourcesUpdate(), resourcesUpdated(), run(), sysModuleCmd(), sysServerHelp(), UCmdExeInit(), unloadAllModules(), and ~UCmdExe().
|
private |
Server, where to get the commands
Referenced by closeClient(), deleteFunction(), executeFunction(), handleAlive(), handleOneMessageFromQueue(), handleOneServerPushMessage(), handleServerCommand(), isClientAlive(), isRxQueueEmpty(), isRxQueueFull(), postCommand(), print(), resourcesUpdated(), run(), sendMsg(), sendMsgAll(), setServer(), stop(), sysServerHelp(), UCmdExeInit(), updateLocalVar(), and ~UCmdExe().
|
private |
Name of the server
Referenced by handleQuit(), handleServerCommand(), name(), setName(), sysServerHelp(), and UCmdExeInit().
|
private |
stopping ther server
Referenced by isStopping(), stop(), and UCmdExeInit().
|
private |
Thread handle for command read thrad.
Referenced by handleMessagesThreadStart(), and stop().
|
private |
Thread running flag
Referenced by handleMessagesThreadStart(), run(), stop(), and UCmdExeInit().
|
private |
Flag to stop thread - terminates the thread
Referenced by handleMessagesThreadStart(), handleOneMessageFromQueue(), run(), runIdle(), stop(), and UCmdExeInit().
|
private |
time to wait before punking silent clients
Referenced by createBaseVar(), and setServer().
|
private |
pointer to allowConnection plag
Referenced by createBaseVar(), and run().
|
private |
number of active clients
Referenced by createBaseVar(), and updateLocalVar().
|
private |
estimated load of server main thread
Referenced by createBaseVar(), and run().
|
private |
number of last client connected
Referenced by createBaseVar(), and updateLocalVar().
|
private |
number of clients ever connected in this session
Referenced by createBaseVar(), and updateLocalVar().
|
private |
is server open for connections
Referenced by createBaseVar(), and updateLocalVar().
|
private |
port number for server
Referenced by createBaseVar(), and updateLocalVar().
|
private |
time between update tests to QT gui
Referenced by createBaseVar(), and run().
|
private |
pointer to allowConnection plag
Referenced by createBaseVar(), and updateLocalVar().
|
private |
If verboseMessages is true, then more messages are prionted to the console
Referenced by executeScriptFile(), handleOneMessageFromQueue(), handleServerCommand(), setVerbose(), systemFunction(), and UCmdExeInit().
|
private |
time to wait before main thread i woken (to test for e.g. timed events)
Referenced by handleServerPushCommand(), runIdle(), and UCmdExeInit().
|
private |
Server log filename Server load figure in the range [0..1]. Is calculated from the number of idle waits executed in a fixed number of seconds.
Referenced by getLoad().