AURobotServers
4
|
#include <urawserverport.h>
Public Member Functions | |
void | run () |
bool | runServer (const char *xmlTag) |
void | terminate () |
URawServerPort () | |
~URawServerPort () | |
Public Member Functions inherited from UServerPort | |
void | connectionLost (int client) |
int | getActiveClientCnt () |
bool | getAllowConnections () |
UServerClient * | getClient (const int i) |
int | getClientCnt () |
char * | getHostName (char *nameBuffer, const int nameBufferCnt) |
int | getLastClient () |
int | getLastClientSerial () |
int | getPort () |
UServerInQueue * | getRxQueue () |
const char * | getServerNamespace () |
const char * | getServerNamespaceAttribute () |
bool | isOpen4Connections () |
bool | isServerNamespaceUse () |
virtual void | messageReceived () |
void | print (const char *preStr) |
bool | runServerThread () |
double | serverAliveLast () |
void | serverIsAlive () |
void | setAllowConnections (bool value) |
void | setPort (const int toPort) |
bool | setResource (UResBase *resource, bool remove) |
void | setServerNamespace (const char *name) |
void | setServerNamespaceAttribute (const char *attStr) |
void | setServerNamespaceUse (bool value) |
void | setVerbose (bool value) |
bool | start () |
bool | stop (bool andWait) |
UServerPort () | |
virtual | ~UServerPort () |
Public Attributes | |
bool | isStopping |
bool | logTimeStamp |
Public Attributes inherited from UServerPort | |
UVariable * | varAlivePunkTime |
Protected Member Functions | |
bool | addCmdHist (const char *line, char *lineHist[], const int MHL, const int MLL, int *lineHistCnt, int *lineHistNewest) |
virtual void | gotNewClient (UServerClient *cnn) |
bool | handleOneMessageFromQueue () |
void | startQueueEmpty () |
void | stopQueueEmpty (bool andWait) |
Protected Member Functions inherited from UServerPort | |
int | getFreeClientHandle () |
bool | serviceClients (int msTimeout) |
void | updateVars () |
Private Attributes | |
ULock | consoleLock |
bool | qeRunning |
bool | qeStop |
pthread_t | thQE |
Additional Inherited Members | |
Protected Attributes inherited from UServerPort | |
bool | allowConnections |
bool | open4Connections |
UResLink | resLink |
This adds some setup to the userver server port and message queue
@author Christian Andersen <jca@elektro.dtu.dk>
URawServerPort::URawServerPort | ( | ) |
Constructor
|
protected |
Add line to command history queue
|
protectedvirtual |
This function is called, when a new client is connected
Reimplemented from UServerPort.
References UServerClient::getClientName(), UServerClient::getLogFilename(), UServerClient::logOpen(), UServerClient::queueRawData, and UServerClient::setLogTimestamp().
|
protected |
Print one message from queue
References UServerInMsg::client, UTime::getMicrosec(), UTime::getSec(), UTime::getTimeAsString(), UServerInMsg::message, and UServerInMsg::rxTime.
void URawServerPort::run | ( | ) |
Run the receive queue empty thread
References UTime::now(), and Wait().
Referenced by runQueueEmpty().
bool URawServerPort::runServer | ( | const char * | xmlTag | ) |
Run the server console prompt
References __SERVER_VERSION__, addCmdHist(), appName, UServerClient::blockSend(), bool2str(), serverPort, and shutDownHandler().
Referenced by main().
|
protected |
start the thread that empties the rx queue
References runQueueEmpty().
|
protected |
stop the thread that empties the rx queue
void URawServerPort::terminate | ( | ) |
Terminate server
Referenced by shutDownHandler().
|
private |
console print lock
bool URawServerPort::isStopping |
Is the server stopping aælready
Referenced by shutDownHandler().
bool URawServerPort::logTimeStamp |
should log be timestamped
|
private |
is queue emptying running
|
private |
should queue emptying stop
|
private |
Handle to queue empty thread