AURobotServers  4
Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
URawServerPort Class Reference

#include <urawserverport.h>

Inheritance diagram for URawServerPort:
Inheritance graph

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 ()
 
UServerClientgetClient (const int i)
 
int getClientCnt ()
 
char * getHostName (char *nameBuffer, const int nameBufferCnt)
 
int getLastClient ()
 
int getLastClientSerial ()
 
int getPort ()
 
UServerInQueuegetRxQueue ()
 
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
UVariablevarAlivePunkTime
 

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
 

Detailed Description

This adds some setup to the userver server port and message queue

    @author Christian Andersen <jca@elektro.dtu.dk>

Constructor & Destructor Documentation

URawServerPort::URawServerPort ( )

Constructor

URawServerPort::~URawServerPort ( )

Destructor

References a, and buf.

Member Function Documentation

bool URawServerPort::addCmdHist ( const char *  line,
char *  lineHist[],
const int  MHL,
const int  MLL,
int *  lineHistCnt,
int *  lineHistNewest 
)
protected

Add line to command history queue

void URawServerPort::gotNewClient ( UServerClient cnn)
protectedvirtual
bool URawServerPort::handleOneMessageFromQueue ( )
protected
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().

void URawServerPort::startQueueEmpty ( )
protected

start the thread that empties the rx queue

References runQueueEmpty().

void URawServerPort::stopQueueEmpty ( bool  andWait)
protected

stop the thread that empties the rx queue

void URawServerPort::terminate ( )

Terminate server

Referenced by shutDownHandler().

Member Data Documentation

ULock URawServerPort::consoleLock
private

console print lock

bool URawServerPort::isStopping

Is the server stopping aælready

Referenced by shutDownHandler().

bool URawServerPort::logTimeStamp

should log be timestamped

bool URawServerPort::qeRunning
private

is queue emptying running

bool URawServerPort::qeStop
private

should queue emptying stop

pthread_t URawServerPort::thQE
private

Handle to queue empty thread


The documentation for this class was generated from the following files: