I have the following code in my app. All this works, i tested by telneting to the machine running the QTcpServer code on port 4567 and I get the "pending connection" message.
How do I do the following:
1. accept the connection.
2. Read the data coming through that connection.
Any help is appreciated. Thanks in advanced.
void mythread::run()
{
connect(tcpServ = SIGNAL(newConnection()), this, SLOT(processConnection)));
exec();
}
void mythread::processConnection()
{
if(tcpServ->hasPendingConnections())
qDebug("Pending connection received");
}
void mythread::run()
{
tcpServ = new QTcpServer;
connect(tcpServ = SIGNAL(newConnection()), this, SLOT(processConnection)));
tcpServ->listen(QHostAddress::Any, 4567);
exec();
}
void mythread::processConnection()
{
if(tcpServ->hasPendingConnections())
qDebug("Pending connection received");
}
To copy to clipboard, switch view to plain text mode
Bookmarks