|
AndroMeta
2.0.0
|
A general-purpose network server base class. More...
#include <MServer.h>
Public Member Functions | |
| MServer (MProcTask *task, MAuth *auth) | |
| virtual | ~MServer () |
| MAuth * | auth () |
| const MAuth * | auth () const |
| MProcTask * | task () |
| bool | listen (int port) |
| virtual MNetProc * | serverSpawn ()=0 |
| virtual bool | onConnect (const mstr &host) |
| virtual bool | onAuthSuccess (mvar &session) |
| virtual void | onAuthFail (mvar &session) |
A general-purpose network server base class.
Used to implement network client applications. The distinction between server and client is somewhat arbitrary, other than the fact that the client initiates the connection and that MServer provides an authentication mechanism using MAuth. Refer to MClient for more information.
| Meta::MServer::MServer | ( | MProcTask * | task, |
| MAuth * | auth | ||
| ) |
Constructor.
| task | The task to used for concurrency and communications processing. |
| auth | The authenticator, null may be passed to bypass authentication. |
| virtual Meta::MServer::~MServer | ( | ) | [virtual] |
Destructor.
| MAuth* Meta::MServer::auth | ( | ) |
| const MAuth* Meta::MServer::auth | ( | ) | const |
| bool Meta::MServer::listen | ( | int | port | ) |
Begin listening on the specified port.
| virtual void Meta::MServer::onAuthFail | ( | mvar & | session | ) | [virtual] |
Called upon authentication failure.
| session | The session data the client attempted to connect with. |
| virtual bool Meta::MServer::onAuthSuccess | ( | mvar & | session | ) | [virtual] |
Called after authentication success.
| session | The session data the client connected with. |
| virtual bool Meta::MServer::onConnect | ( | const mstr & | host | ) | [virtual] |
| host | The host/IP address of the client attempting to connect. |
| virtual MNetProc* Meta::MServer::serverSpawn | ( | ) | [pure virtual] |
1.7.6.1