Fix CPU usage issues.
This commit is contained in:
parent
46e4823daa
commit
414cec2797
3 changed files with 6 additions and 1 deletions
|
@ -201,6 +201,8 @@ namespace Connector_HTTP{
|
|||
fprintf(stderr, "Could not parse the following:\n%s\n", conn.Received().c_str());
|
||||
#endif
|
||||
}
|
||||
}else{
|
||||
usleep(10000);//sleep 10ms
|
||||
}
|
||||
if (ready4data){
|
||||
if (!inited){
|
||||
|
|
|
@ -58,6 +58,8 @@ namespace Connector_HTTP{
|
|||
fprintf(stderr, "Could not parse the following:\n%s\n", conn.Received().c_str());
|
||||
#endif
|
||||
}
|
||||
}else{
|
||||
usleep(10000);//sleep 10ms
|
||||
}
|
||||
if (ready4data){
|
||||
if (!inited){
|
||||
|
|
|
@ -76,10 +76,11 @@ int Connector_RTMP::Connector_RTMP(Socket::Connection conn){
|
|||
bool firstrun = true;
|
||||
|
||||
while (Socket.connected()){
|
||||
usleep(10000);//sleep 10ms to prevent high CPU usage
|
||||
if (Socket.spool() || firstrun){
|
||||
firstrun = false;
|
||||
parseChunk(Socket.Received());
|
||||
}else{
|
||||
usleep(10000);//sleep 10ms to prevent high CPU usage
|
||||
}
|
||||
if (ready4data){
|
||||
if (!inited){
|
||||
|
|
Loading…
Add table
Reference in a new issue