NewNet::FactorySocket< ServerType, ClientType > Class Template Reference

Abstract base class for factory sockets. More...

#include <nnfactorysocket.h>

Inheritance diagram for NewNet::FactorySocket< ServerType, ClientType >:

NewNet::Object NewNet::TcpFactorySocket< ClientType > NewNet::UnixFactorySocket< ClientType > List of all members.

Public Member Functions

 FactorySocket ()
 Construct a factory socket.
 FactorySocket (ServerType *serverSocket)
 Construct a factory socket based on the specified server socket.
ServerType * serverSocket ()
 Returns the server socket.

Public Attributes

Event< ClientType * > clientAcceptedEvent
 Invoked when a new client socket has been created.

Detailed Description

template<class ServerType, class ClientType>
class NewNet::FactorySocket< ServerType, ClientType >

This provides a base class for factory sockets: server sockets that automatically create a specified client socket type. Note: your application will most likely use TcpFactorySocket or UnixFactorySocket instead of using this class directly.

Definition at line 33 of file nnfactorysocket.h.


Constructor & Destructor Documentation

template<class ServerType, class ClientType>
NewNet::FactorySocket< ServerType, ClientType >::FactorySocket (  )  [inline]

Create a new factory socket by instantiating a new socket of type ServerType using the default constructor. Note: stores a RefPtr to the newly created ServerType.

Definition at line 40 of file nnfactorysocket.h.

template<class ServerType, class ClientType>
NewNet::FactorySocket< ServerType, ClientType >::FactorySocket ( ServerType *  serverSocket  )  [inline]

Create a new factory socket based on the the specified server socket. Note: this stores a RefPtr to the specified server socket.

Definition at line 49 of file nnfactorysocket.h.


Member Function Documentation

template<class ServerType, class ClientType>
ServerType* NewNet::FactorySocket< ServerType, ClientType >::serverSocket (  )  [inline]

Use this to make the factory socket listen on a port or path (depending on the server socket type used) or to add it to the reactor.

Definition at line 58 of file nnfactorysocket.h.


Member Data Documentation

template<class ServerType, class ClientType>
Event<ClientType *> NewNet::FactorySocket< ServerType, ClientType >::clientAcceptedEvent

This event is invoked when a new client socket has been created. Note: you don't have to add the created client to the reactor. FactorySocket does that for you.

Definition at line 67 of file nnfactorysocket.h.


The documentation for this class was generated from the following file:
Generated on Sun Jan 7 14:00:01 2007 for NewNet by  doxygen 1.5.1