
Originally Posted by
jiveaxe
Is right connecting recvQuit() to QTcpServer::newConnection() signal?
No, you should get new connection socket, and connect its readyRead signal to recvQuit.
In MainApp I haven't QTcpSocket object (only QTcpServer): I need to create one, right?
When QTcpServer::newConnection is emitted, you should do:
void MainApp::newConnectionSlot()
{
// Loop on all incoming connections.
while(tcpServer->hasPendingConnections()) {
QTcpSocket *socket
= tcpServer
->nextPendingConnection
();
// Connect socket's signal, etc...
}
}
void MainApp::newConnectionSlot()
{
// Loop on all incoming connections.
while(tcpServer->hasPendingConnections()) {
QTcpSocket *socket = tcpServer->nextPendingConnection();
// Connect socket's signal, etc...
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks