Meta::MClient Class Reference

A general-purpose network client base class. More...

#include <MClient.h>

List of all members.

Public Member Functions

 MClient (MProcTask *task)
virtual ~MClient ()
MProcTasktask ()
bool connect (const mstr &host, int port, const mstr &user="", const mstr &key="", const mvar &session=0)
virtual MNetProcclientSpawn ()=0

Detailed Description

A general-purpose network client base class.

A client spawns an application-specific MNetProc subclass and connects to a host, sending authentication information. The MNetProc uses the functionality provided by MCommunicator and MProc to implement a (recurrent) request / response worker process which communicates with a server via MCommunicator::send() and MCommunicator::receive().


Constructor & Destructor Documentation

Meta::MClient::MClient ( MProcTask task  ) 

Constructor.

Parameters:
task The task to be used for concurrency/communications processing.
virtual Meta::MClient::~MClient (  )  [virtual]

Destructor.


Member Function Documentation

virtual MNetProc* Meta::MClient::clientSpawn (  )  [pure virtual]
Returns:
The application-specific MNetProc subclass that is created upon connecting to handle communication and processing with the server. User is responsible for destroying any MNetProc's created.
bool Meta::MClient::connect ( const mstr host,
int  port,
const mstr user = "",
const mstr key = "",
const mvar session = 0 
)

Connect to a server with the specified authentication information.

Parameters:
host The remote host to connect to.
port The remote host port.
user User to connect as.
key Authentication key, see MAuth::generateKey().
session Application-specific session data.
MProcTask* Meta::MClient::task (  ) 
Returns:
The task that the client was constructed with.

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

Generated on Wed Mar 24 16:22:42 2010 for AndroMeta by  doxygen 1.6.1