#include "serverpool.h"
+#include "state.pb.h"
using namespace std;
{
delete[] servers;
}
+
+CubemapStateProto ServerPool::serialize()
+{
+ CubemapStateProto state;
+
+ for (int i = 0; i < num_servers; ++i) {
+ CubemapStateProto local_state = servers[i].serialize();
+
+ // The stream state should be identical between the servers, so we only store it once.
+ if (i == 0) {
+ state.mutable_streams()->MergeFrom(local_state.streams());
+ }
+ for (int j = 0; j < local_state.clients_size(); ++j) {
+ state.add_clients()->MergeFrom(local_state.clients(j));
+ }
+ }
+
+ return state;
+}
void ServerPool::add_client(int sock)
{
}
}
+void ServerPool::stop()
+{
+ for (int i = 0; i < num_servers; ++i) {
+ servers[i].stop();
+ }
+}
+
vector<ClientStats> ServerPool::get_client_stats() const
{
vector<ClientStats> ret;