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

fix #149, RTMP/HTTP support bind to <[ip:]port>. 2.0.148

This commit is contained in:
winlin 2015-03-23 23:13:57 +08:00
parent fcab17741c
commit b6feb0742f
12 changed files with 148 additions and 83 deletions

View file

@ -110,6 +110,25 @@ int srs_get_log_level(string level)
}
}
void srs_parse_endpoint(string ip_port, string& ip, string& port)
{
ip = "0.0.0.0";
port = ip_port;
size_t pos = string::npos;
if ((pos = port.find(":")) != string::npos) {
ip = port.substr(0, pos);
port = port.substr(pos + 1);
}
}
void srs_parse_endpoint(string ip_port, string& ip, int& port)
{
std::string the_port;
srs_parse_endpoint(ip_port, ip, the_port);
port = ::atoi(the_port.c_str());
}
static SrsRusage _srs_system_rusage;
SrsRusage::SrsRusage()