I'm trying to understand how QTcpSocket and QTcpServer works together. So I wrote this simple example, which starts server and client socket on localhost:
QTcpServer server;
qDebug() << "Listen: " << server.listen( QHostAddress::Any, 10590);
usleep( 500000); //1/2 sec
QTcpSocket client;
client.connectToHost( QHostAddress( "127.0.0.1"), 10590);
usleep( 5000000);
qDebug() << "Client socket available: " << client.isValid();
qDebug() << "Pending connections:" << server.hasPendingConnections();
And I got this output:
Listen: true
Client socket available: true
Pending connections false
Why there is no pending connections?
PS> I don't wanna use SLOT/SIGNALS mechanism.