1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

use kernel utility int2str and float2str

This commit is contained in:
winlin 2015-09-24 17:54:58 +08:00
parent 6efd2dd27e
commit 9ead08725d
14 changed files with 104 additions and 75 deletions

View file

@ -30,6 +30,7 @@
#include <srs_core.hpp>
#include <vector>
#include <string>
/**
* the round-robin load balance algorithm,
@ -42,21 +43,15 @@ private:
int index;
// total scheduled count.
u_int32_t count;
// current selected server.
std::string elem;
public:
SrsLbRoundRobin();
virtual ~SrsLbRoundRobin();
public:
virtual u_int32_t current();
public:
template<typename T>
const T& select(const std::vector<T>& servers)
{
srs_assert(!servers.empty());
index = (int)(count++ % servers.size());
return servers.at(index);
}
virtual std::string selected();
virtual std::string select(const std::vector<std::string>& servers);
};
#endif