Moving on. I decided to take a different tact, and maybe now I'm doing it the right way.
@
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
PollController *pollController = new PollController();
pollController->setup(1,1000);
QThread *pollThread = new QThread();
QObject::connect(pollThread,SIGNAL(started()),pollController,SLOT(startPolling()));
pollController->moveToThread(pollThread);
pollThread->start();
return a.exec();
}
@
Inside the "pollController" class, I create a new instance of my QTcpSocket logger class when I have data to report to the web server.
@
void PollController::msgReceived(QString &msg)
{
QString host = "web-dev";
int port = 85;
//QString msg = "99.00.050.00.12345678.*";
qDebug() << "pollController received signal from analyze:" << msg;
//emit(msgToLog(msg));
// Fire up a new logger
Logger *logger = new Logger(this);
logger->setup(host,port,msg);
}
@
It seems to work, I just wonder if I'm really doing things correctly now or am I just getting lucky that it's working in testing?