rmanconnect::Server Class Reference

Represents a listening Server, ready to accept incoming images. More...

#include <Server.h>

List of all members.

Public Member Functions

 Server ()
 Constructor.
 Server (int port)
 Constructor.
 ~Server ()
 Destructor.
void connect (int port, bool seach=false)
 Connects the server to a port.
void accept ()
 Sets up the server to accept an incoming Client connections.
Data listen ()
 Listens for incoming messages from a Client.
void quit ()
 Sends a 'quit' message to the server.
bool isConnected ()
 Returns whether or not the server is connected to a port.
int getPort ()
 Returns the port the server is currently connected to.

Detailed Description

Represents a listening Server, ready to accept incoming images.

This class wraps up the provision of a TCP port, and handles incoming connections from Client objects when they're ready to send image data.


Constructor & Destructor Documentation

Server::Server (  ) 

Constructor.

Creates a new server. By default the Server is not connected at creation time.

Server::Server ( int  port  ) 

Constructor.

Creates a new server and calls connect() with the specified port number.

Server::~Server (  ) 

Destructor.

Shuts down the server, closing any open ports if the server is connected.


Member Function Documentation

void Server::connect ( int  port,
bool  seach = false 
)

Connects the server to a port.

If true is passed as the second parameter then the server will search for the first available port if the specified one is not available. To find out which port the server managed to connect to, call getPort() afterwards.

Data Server::listen (  ) 

Listens for incoming messages from a Client.

This function blocks (and so may be require running on a separate thread), returning once a Client has sent a message.

The returned Data object is filled with the relevant information and passed back ready for handling by the parent application.

void Server::quit (  ) 

Sends a 'quit' message to the server.

This can be used to exit a listening loop running on a separate thread.


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

Generated on Fri Jan 8 19:16:27 2010 for RmanConnect by  doxygen 1.6.1