incClients();
media=new MediaPlayer();
mediaprovider=new ServerMediaFile(cfgBase,media);
+ netLogFile = NULL;
rrproc.init();
}
delete media;
delete mediaprovider;
+
+ if (netLogFile)
+ {
+ fclose(netLogFile);
+ netLogFile = NULL;
+ }
}
void VompClient::incClients()
#endif
} */
+void VompClient::netLog()
+{
+ // Hook, called from rrproc login after client has logged in.
+ // See if this MVP config says to do network logging, if so open a log
+ // The config object will be usable now since it's set up in login
+
+ char* doNetLogging = config.getValueString("Advanced", "Network logging");
+ if (doNetLogging)
+ {
+ if (!strcasecmp(doNetLogging, "on"))
+ {
+ char* netLogFileName = config.getValueString("Advanced", "Network logging file");
+ if (netLogFileName)
+ {
+ netLogFile = fopen(netLogFileName, "a");
+ if (netLogFile) log->log("Client", Log::DEBUG, "Client network logging started");
+
+ delete[] netLogFileName;
+ }
+ }
+
+ delete[] doNetLogging;
+ }
+}
+
void VompClientStartThread(void* arg)
{
VompClient* m = (VompClient*)arg;
UCHAR* data;
ULONG kaTimeStamp;
+ ULONG logStringLen;
while(1)
{
break;
}
}
+ else if (channelID == 4)
+ {
+ if (!tcp.readData((UCHAR*)&logStringLen, sizeof(ULONG))) break;
+ logStringLen = ntohl(logStringLen);
+
+ log->log("Client", Log::DEBUG, "Received chan=%lu loglen=%lu", channelID, logStringLen);
+
+ UCHAR buffer[logStringLen + 1];
+ if (!tcp.readData((UCHAR*)&buffer, logStringLen)) break;
+ buffer[logStringLen] = '\0';
+
+// log->log("Client", Log::INFO, "Client said: '%s'", buffer);
+ if (netLogFile)
+ {
+ if (fputs((const char*)buffer, netLogFile) == EOF)
+ {
+ fclose(netLogFile);
+ netLogFile = NULL;
+ }
+ }
+ }
else
{
log->log("Client", Log::ERR, "Incoming channel number unknown");