|
AndroMeta
2.0.0
|
A general-purpose network client base class. More...
#include <MClient.h>
Public Member Functions | |
| MClient (MProcTask *task) | |
| virtual | ~MClient () |
| MProcTask * | task () |
| bool | connect (const mstr &host, int port, const mstr &user="", const mstr &key="", const mvar &session=0) |
| virtual MNetProc * | clientSpawn ()=0 |
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.
| Meta::MClient::MClient | ( | MProcTask * | task | ) |
Constructor.
| task | The task to be used for concurrency/communications processing. |
| virtual Meta::MClient::~MClient | ( | ) | [virtual] |
Destructor.
| virtual MNetProc* Meta::MClient::clientSpawn | ( | ) | [pure virtual] |
| 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.
| host | The remote host to connect to. |
| port | The remote host port. |
| user | User to connect as. |
| key | Authentication key, see MEncoder::generateKey(). |
| session | Application-specific session data. |
1.7.6.1