Implemented stats logging on the connector level - closes #1

This commit is contained in:
Thulinma 2011-11-26 03:16:28 +01:00
parent 890a8a89c7
commit 0716c319a6
5 changed files with 53 additions and 12 deletions

View file

@ -175,6 +175,7 @@ namespace Connector_HTTP{
int Segment = -1;
int ReqFragment = -1;
int temp;
unsigned int lastStats = 0;
//int CurrentFragment = -1; later herbruiken?
while (conn.connected() && !FLV::Parse_Error){
@ -263,6 +264,14 @@ namespace Connector_HTTP{
fprintf(stderr, "Sending a video fragment. %i left in buffer, %i requested\n", (int)Flash_FragBuffer.size(), Flash_RequestPending);
#endif
}
if (inited){
unsigned int now = time(0);
if (now != lastStats){
lastStats = now;
std::string stat = "S "+conn.getStats();
ss.write(stat);
}
}
ss.canRead();
switch (ss.ready()){
case -1: