Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

PIAVE::Server Class Reference

listens on a tcp port for incomming commands. More...

#include <server.hh>

Inheritance diagram for PIAVE::Server:

PIAVE::KdenLiveServer List of all members.

Public Methods

int execute ()
 Starts the execution of the cutter.

void sendMessage (const std::string &str)
 Sends a message down the communication socket.


Protected Methods

virtual void startProcessCommandsLoop ()=0
 Process any commands that have been recieved, send any acknowledgements that are required.


Private Methods

void initListenSocket ()
 Initialise a server and start listening for connections.

void closeListenSocket ()
 Close down the socket that listens for connections.

void closeCommSocket ()
 Close down the socket that communicates with the client.


Private Attributes

State _state
 This server is a little state mashine.

unsigned short m_port
 The port that the cutter listens in on.

int m_listenSocket
 The socket used for listening.

int m_commSocket
 The socket used for communication.

sockaddr_in m_socketAddress
 The internet address that this socket is bound to.

std::string m_commandBuffer
 The command buffer, stores partial commands until the rest of them is picked up.

int m_totalBytesRead
 The total bytes read in the recieveMessage method.

std::string m_messageBuffer
 A string buffer which stores recieved messages until they are complete.


Detailed Description

listens on a tcp port for incomming commands.

This base class handles the necessary tcpsetup required for the renderer to connect to a client

This class is implemented as a "state mashine".

state_not_initialized <-\ -> state_not_connected, <---\ | -> state_connected, <----\ --/ | -> state_process_commands, --/ | -> state_shutting_down ---/ -> state_error_connecting,

Author:
Jason Wood, Rolf Dubitzky


Member Function Documentation

int Server::execute  
 

Starts the execution of the cutter.

This is the main loop; by the time this function is called, the server is already listening for connections.

void Server::sendMessage const std::string &    str
 

Sends a message down the communication socket.

Convenience function.


Member Data Documentation

int PIAVE::Server::m_totalBytesRead [private]
 

The total bytes read in the recieveMessage method.

This resets to 0 whenever a full message has been recieved.


The documentation for this class was generated from the following files:
Generated on Tue Oct 14 20:45:37 2003 for piave by doxygen1.2.18