34 #include <QCoreApplication>
42 Server *serverInstance = 0;
44 int main(
int argc,
char *argv[])
46 QCoreApplication app(argc, argv);
47 QStringList args = app.arguments();
48 char *debugConfigFile = NULL;
51 QString hostAddressStr;
54 setvbuf(stdout, NULL, _IOLBF, 0);
56 QRegExp optionPort(
"-port");
57 QRegExp optionIP(
"-ip");
58 QRegExp optionDebugFile(
"-debugconfig");
60 for (
int i = 1; i < args.size(); ++i) {
61 if (optionPort.indexIn(args.at(i)) != -1 ) {
62 portNumber= args.at(i+1).toInt();
64 qDebug() <<
"port is " << portNumber;
66 else if (optionIP.indexIn(args.at(i)) != -1 ) {
67 hostAddressStr = args.at(i+1);
69 qDebug() <<
"ip is " << hostAddressStr;
71 else if (optionDebugFile.indexIn(args.at(i)) != -1 ) {
72 debugConfigFile = argv[i+1];
74 qDebug() <<
"rdklogger debug file is " << debugConfigFile;
81 RDK_LOG(RDK_LOG_DEBUG,
"LOG.RDK.TRM",
"This is a test line");
83 if (portNumber < 0 || portNumber > 65535 || hostAddressStr.isEmpty()) {
84 printf(
"\r\n%s: <ip address> <port number> \r\n", args.at(0).toUtf8().data());
88 QHostAddress hostAddress(hostAddressStr);
89 Server server(hostAddress, portNumber);
90 serverInstance = &server;