Meta::MClient Class Reference
A general-purpose network client base class.
More...
#include <MClient.h>
List of all members.
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
Constructor.
- Parameters:
-
| task | The task to be used for concurrency/communications processing. |
| virtual Meta::MClient::~MClient |
( |
|
) |
[virtual] |
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. |
- Returns:
- The task that the client was constructed with.
The documentation for this class was generated from the following file: