2 #define _SERVERPOOL_H 1
10 // Provides services such as load-balancing between a number of Server instances.
13 ServerPool(int num_servers);
16 // Fills streams() and clients().
17 CubemapStateProto serialize();
19 // Picks a server (round-robin) and allocates the given client to it.
20 void add_client(int sock);
21 void add_client_from_serialized(const ClientProto &client);
23 // Adds the given stream to all the servers.
24 void add_stream(const std::string &stream_id);
25 void add_stream_from_serialized(const StreamProto &stream);
27 // Adds the given data to all the servers.
28 void set_header(const std::string &stream_id, const std::string &header);
29 void add_data(const std::string &stream_id, const char *data, size_t bytes);
31 // Connects the given stream to the given mark pool for all the servers.
32 void set_mark_pool(const std::string &stream_id, MarkPool *mark_pool);
34 // Starts all the servers.
37 // Stops all the servers.
40 std::vector<ClientStats> get_client_stats() const;
44 int num_servers, clients_added;
46 ServerPool(const ServerPool &);
49 #endif // !defined(_SERVERPOOL_H)