diff --git a/server/src/sock/pool.hpp b/server/src/sock/pool.hpp index b89a6fc..19ab56f 100644 --- a/server/src/sock/pool.hpp +++ b/server/src/sock/pool.hpp @@ -1,6 +1,7 @@ #ifndef SOSC_POOL_H #define SOSC_POOL_H +#include #include #include #include @@ -33,6 +34,8 @@ public: void Start(); bool AddClient(T* client); + int ClientCount() const; + void Stop(); protected: virtual void ProcessClient(T* client) = 0; @@ -86,6 +89,14 @@ bool Pool::AddClient(T* client) { return false; } + +template +int Pool::ClientCount() const { + int count = 0; + for(auto i = this->stacks.begin(); i != this->stacks.end(); ++i) + count += i->ClientCount(); + return count; +} } #endif