21 #ifndef G_NET_MULTI_SERVER__H
22 #define G_NET_MULTI_SERVER__H
32 class MultiServerImp ;
33 class MultiServerPtr ;
83 void operator=(
const MultiServerPtr & ) ;
97 typedef std::vector<Address> AddressList ;
115 void init(
const AddressList & address_list ) ;
131 static bool canBind(
const AddressList & listening_address_list ,
bool do_throw ) ;
140 static AddressList
addressList(
const AddressList & ,
unsigned int port ) ;
158 void serverReport(
const std::string & server_type )
const ;
168 typedef std::list<MultiServerPtr> List ;
static AddressList addressList(const Address &)
A trivial convenience fuction that returns the given address as a single-element list.
An abstract base class for the GNet::Server's connection to a remote client.
A private implementation class used by GNet::MultiServer.
void swap(MultiServerPtr &)
Swaps internals with the other.
The GNet::Address class encapsulates a TCP/UDP transport address.
std::vector< std::string > StringArray
A std::vector of std::strings.
MultiServerImp(MultiServer &, ExceptionHandler &, const Address &)
Constructor.
A network server class which listens on a specific port and spins off ServerPeer objects for each inc...
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket events...
static bool canBind(const AddressList &listening_address_list, bool do_throw)
Checks that the specified addresses can be bound.
void cleanup()
Does cleanup.
A structure used in GNet::MultiServer::newPeer().
virtual ~MultiServer()
Destructor.
A private implementation class used by GNet::MultiServer.
MultiServerPtr(ServerImp *=nullptr)
Constructor.
void init(const AddressList &address_list)
Initilisation after default construction.
virtual ServerPeer * newPeer(PeerInfo, ServerInfo)=0
A factory method which new()s a ServerPeer-derived object.
void serverCleanup()
Should be called from all derived classes' destructors so that peer objects can use their Server obje...
~MultiServerPtr()
Destructor.
A server that listens on more than one interface using a facade pattern to multiple GNet::Server inst...
Address m_address
The server address that the peer connected to.
std::pair< bool, Address > firstAddress() const
Returns the first listening address.
MultiServer(ExceptionHandler &, const AddressList &address_list)
Constructor.
A structure used in GNet::Server::newPeer().
void serverReport(const std::string &server_type) const
Writes to the system log a summary of the underlying server objects and their addresses.
void operator=(const MultiServerPtr &)
Assignment operator.