diff --git a/src/conn_http_dynamic.cpp b/src/conn_http_dynamic.cpp index a828ca05..993c9934 100644 --- a/src/conn_http_dynamic.cpp +++ b/src/conn_http_dynamic.cpp @@ -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){ diff --git a/src/conn_http_progressive.cpp b/src/conn_http_progressive.cpp index c626a471..dad3b6d5 100644 --- a/src/conn_http_progressive.cpp +++ b/src/conn_http_progressive.cpp @@ -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){ diff --git a/src/conn_rtmp.cpp b/src/conn_rtmp.cpp index d4c566da..35bea93f 100644 --- a/src/conn_rtmp.cpp +++ b/src/conn_rtmp.cpp @@ -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){