21 #ifndef G_MULTI_SERVER_H
22 #define G_MULTI_SERVER_H
35 class MultiServerImp ;
36 class MultiServerPtr ;
108 static bool canBind(
const AddressList & listening_address_list ,
bool do_throw ) ;
117 static AddressList
addressList(
const AddressList & ,
unsigned int port ) ;
129 MultiServer(
const AddressList & address_list ,
bool use_connection_lookup ) ;
142 void init(
const AddressList & address_list ) ;
164 void serverReport(
const std::string & server_type )
const ;
174 typedef std::list<MultiServerPtr> List ;
175 std::auto_ptr<GNet::ConnectionLookup> m_connection_lookup ;
MultiServerPtr(ServerImp *=NULL)
Constructor.
static AddressList addressList(const Address &)
A trivial convenience fuction that returns the given addresses 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.
MultiServer()
Default constructor. Initialise with init().
void swap(MultiServerPtr &)
Swaps internals with the other.
std::list< std::string > Strings
A std::list of std::strings.
The Address class encapsulates an IP transport address.
Server::PeerInfo PeerInfo
A class for getting more information about a connection from the operating system.
A network server class which listens on a specific port and spins off ServerPeer objects for each inc...
virtual ServerPeer * newPeer(PeerInfo)
Server peer factory method.
static bool canBind(const AddressList &listening_address_list, bool do_throw)
Checks that the specified addresses can be bound.
GNet::MultiServerImp ServerImp
void cleanup()
Does cleanup.
virtual ServerPeer * newPeer(PeerInfo)=0
A factory method which new()s a ServerPeer-derived object.
virtual ~MultiServer()
Destructor.
A private implementation class used by GNet::MultiServer.
void init(const AddressList &address_list)
Initilisation after default construction.
MultiServerImp(MultiServer &ms, const Address &, ConnectionLookup *)
Constructor.
std::list< Address > AddressList
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 Server instances...
std::pair< bool, Address > firstAddress() const
Returns the first listening address.
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.