AndroMeta  2.0.0
Public Member Functions
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(). See MEncoder for generating keys.


Constructor & Destructor Documentation

Constructor.

Parameters:
taskThe 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:
hostThe remote host to connect to.
portThe remote host port.
userUser to connect as.
keyAuthentication key, see MEncoder::generateKey().
sessionApplication-specific session data.
Returns:
The task that the client was constructed with.

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