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

@ -23,6 +23,8 @@
#include <srs_kernel_balance.hpp>
using namespace std;
SrsLbRoundRobin::SrsLbRoundRobin()
{
index = -1;
@ -38,3 +40,18 @@ u_int32_t SrsLbRoundRobin::current()
return index;
}
string SrsLbRoundRobin::selected()
{
return elem;
}
string SrsLbRoundRobin::select(const vector<string>& servers)
{
srs_assert(!servers.empty());
index = (int)(count++ % servers.size());
elem = servers.at(index);
return elem;
}