|
E-MailRelay
|
A server that listens on more than one interface using a facade pattern to multiple GNet::Server instances. More...
#include <gmultiserver.h>
Inheritance diagram for GNet::MultiServer:Classes | |
| struct | ServerInfo |
| A structure used in GNet::MultiServer::newPeer(). More... | |
Public Types | |
| typedef std::vector< Address > | AddressList |
| typedef Server::PeerInfo | PeerInfo |
Public Member Functions | |
| MultiServer (ExceptionHandler &, const AddressList &address_list) | |
| Constructor. More... | |
| MultiServer (ExceptionHandler &) | |
| Default constructor. Initialise with init(). | |
| void | init (const AddressList &address_list) |
| Initilisation after default construction. More... | |
| virtual | ~MultiServer () |
| Destructor. | |
| std::pair< bool, Address > | firstAddress () const |
| Returns the first listening address. More... | |
| virtual ServerPeer * | newPeer (PeerInfo, ServerInfo)=0 |
| A factory method which new()s a ServerPeer-derived object. More... | |
Static Public Member Functions | |
| static bool | canBind (const AddressList &listening_address_list, bool do_throw) |
| Checks that the specified addresses can be bound. More... | |
| static AddressList | addressList (const Address &) |
| A trivial convenience fuction that returns the given address as a single-element list. More... | |
| static AddressList | addressList (const AddressList &, unsigned int port) |
| Returns the given list of addresses with the port set correctly. More... | |
| static AddressList | addressList (const G::StringArray &, unsigned int port) |
| A convenience function that returns a list of listening addresses given a list of listening interfaces and a port number. More... | |
Protected Member Functions | |
| void | serverCleanup () |
| Should be called from all derived classes' destructors so that peer objects can use their Server objects safely during their own destruction. More... | |
| void | serverReport (const std::string &server_type) const |
| Writes to the system log a summary of the underlying server objects and their addresses. More... | |
A server that listens on more than one interface using a facade pattern to multiple GNet::Server instances.
Definition at line 94 of file gmultiserver.h.
| GNet::MultiServer::MultiServer | ( | ExceptionHandler & | eh, |
| const AddressList & | address_list | ||
| ) |
Constructor.
The server listens on on the specific (local) interfaces.
Precondition: ! address_list.empty()
Definition at line 29 of file gmultiserver.cpp.
|
static |
A trivial convenience fuction that returns the given address as a single-element list.
Definition at line 73 of file gmultiserver.cpp.
|
static |
Returns the given list of addresses with the port set correctly.
If the given list is empty then a single 'any' address is returned.
Definition at line 81 of file gmultiserver.cpp.
|
static |
A convenience function that returns a list of listening addresses given a list of listening interfaces and a port number.
If the list of interfaces is empty then a single 'any' address is returned.
Definition at line 99 of file gmultiserver.cpp.
|
static |
Checks that the specified addresses can be bound.
Throws CannotBind if an address cannot be bound and 'do_throw' is true.
Definition at line 63 of file gmultiserver.cpp.
| std::pair< bool, GNet::Address > GNet::MultiServer::firstAddress | ( | ) | const |
Returns the first listening address.
The boolean value is false if none.
Definition at line 151 of file gmultiserver.cpp.
| void GNet::MultiServer::init | ( | const AddressList & | address_list | ) |
Initilisation after default construction.
Precondition: ! address_list.empty()
Definition at line 46 of file gmultiserver.cpp.
|
pure virtual |
A factory method which new()s a ServerPeer-derived object.
See Server for the details.
Implemented in GSmtp::AdminServer.
|
protected |
Should be called from all derived classes' destructors so that peer objects can use their Server objects safely during their own destruction.
Definition at line 128 of file gmultiserver.cpp.
|
protected |
Writes to the system log a summary of the underlying server objects and their addresses.
Definition at line 142 of file gmultiserver.cpp.
1.8.9.1