Vault
4.1
|
Implement a subclass of VClientSessionFactory (specifically, the createSession() method) to create a socket listener that will create the desired type of VClientSession whenever an incoming connection is accepted on that socket. More...
#include <vclientsession.h>
Public Member Functions | |
VClientSessionFactory (VManagementInterface *manager, VServer *server) | |
Initializes the factory. | |
virtual VClientSessionPtr | createSession (VSocket *socket, VListenerThread *ownerThread)=0 |
This is the method you must implement to instantiate the concrete type of VClientSession. | |
void | addSessionToServer (VClientSessionPtr session) |
Adds the specified session to the server; the server keeps track of its sessions for purposes of broadcasting, clean shutdown, etc. | |
void | setManager (VManagementInterface *manager) |
Sets the management interface to receive notifications. | |
Protected Member Functions | |
VClientSessionFactory (const VClientSessionFactory &) | |
VClientSessionFactory & | operator= (const VClientSessionFactory &) |
Protected Attributes | |
VManagementInterface * | mManager |
The object that will be notified of session events. | |
VServer * | mServer |
The server that will be notified of session creation. |
Implement a subclass of VClientSessionFactory (specifically, the createSession() method) to create a socket listener that will create the desired type of VClientSession whenever an incoming connection is accepted on that socket.
This class is a parameter to the VListenerThread constructor.
Definition at line 210 of file vclientsession.h.
VClientSessionFactory::VClientSessionFactory | ( | VManagementInterface * | manager, |
VServer * | server | ||
) | [inline] |
Initializes the factory.
manager | the manager to be supplied to sessions that are created |
server | the server to be supplied to sessions that are created |
Definition at line 218 of file vclientsession.h.
virtual VClientSessionPtr VClientSessionFactory::createSession | ( | VSocket * | socket, |
VListenerThread * | ownerThread | ||
) | [pure virtual] |
This is the method you must implement to instantiate the concrete type of VClientSession.
socket | the socket on which the client has connected |
ownerThread | the listener thread that accepted the connection |
void VClientSessionFactory::addSessionToServer | ( | VClientSessionPtr | session | ) |
Adds the specified session to the server; the server keeps track of its sessions for purposes of broadcasting, clean shutdown, etc.
session | the session that has been created |
Definition at line 231 of file vclientsession.cpp.
References VServer::addClientSession(), mServer, and NULL.
void VClientSessionFactory::setManager | ( | VManagementInterface * | manager | ) | [inline] |
Sets the management interface to receive notifications.
May be NULL if no notifications are to be given. This manager may be passed to the sessions created and their threads.
manager | the manager to notify, or NULL |
Definition at line 242 of file vclientsession.h.
References mManager.