Exemplo n.º 1
0
void Server::incomingConnection(int socketDescriptor)
{

    qDebug() << socketDescriptor << "Connecting...";
    ConnectionThread *clientThread = new ConnectionThread(socketDescriptor, this);
    connect(clientThread, SIGNAL(finished()), clientThread, SLOT(deleteLater()));

    clientThread->start();
}
Exemplo n.º 2
0
//! 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();
        }
    }
}
Exemplo n.º 3
0
void Server::incomingConnection(int socketDescriptor)
{
    ConnectionThread * thread = new ConnectionThread(logger, smsManager, socketDescriptor, this);
    connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
    thread->start();
}
Exemplo n.º 4
0
void TimeServer::incomingConnection(int socketDescriptor)
{
  ConnectionThread *thread = new ConnectionThread(socketDescriptor);
  connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
  thread->start();
}