void Server::incomingConnection(int socketDescriptor) { qDebug() << socketDescriptor << "Connecting..."; ConnectionThread *clientThread = new ConnectionThread(socketDescriptor, this); connect(clientThread, SIGNAL(finished()), clientThread, SLOT(deleteLater())); clientThread->start(); }
//! Receives the connections and creates a new ConnectionThread for each client. void ConnectionReceiver::run() { while(running) { if(tcpServer->waitForNewConnection(-1, NULL)) { if(!accepting) { QTcpSocket* s = tcpServer->nextPendingConnection(); s->disconnectFromHost(); delete s; continue; } qDebug() << "Clientconnected"; ConnectionThread* connection = new ConnectionThread(tcpServer->nextPendingConnection(), server); connection->start(); } } }
void Server::incomingConnection(int socketDescriptor) { ConnectionThread * thread = new ConnectionThread(logger, smsManager, socketDescriptor, this); connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); thread->start(); }
void TimeServer::incomingConnection(int socketDescriptor) { ConnectionThread *thread = new ConnectionThread(socketDescriptor); connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); thread->start(); }