int SslServer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QTcpServer::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotThreadFinished(); break;
        case 1: slotQuitThread(); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}
Esempio n. 2
0
void SslServer::incomingConnection(int socketDescriptor)
{
    //
    // A new connection is incomming, create a new connection object and append it to the connection list
    //
    SslServerConnection *newIncommingConnection = new SslServerConnection (socketDescriptor, &mutex, this);

    // Add the connection to the current connected list
    this->connections->add(newIncommingConnection);

    // When we receives the connectionIsClosed signal we exit the eventloop in the thread
    QObject::connect(newIncommingConnection, SIGNAL(connectionIsClosed()), this, SLOT(slotQuitThread()));
    // When the thread is finished cleanup
    QObject::connect(newIncommingConnection, SIGNAL(finished()), this, SLOT(slotThreadFinished()));
    // Received a disconnect from the service
    QObject::connect(newIncommingConnection, SIGNAL(setDisconnected(int)), this, SIGNAL(setDisconnected(int)));
    // Received an error from the service
    QObject::connect(newIncommingConnection, SIGNAL(setError(int,QString)), this, SIGNAL(setError(int,QString)));
    // Received a user input is needed
    QObject::connect(newIncommingConnection, SIGNAL(needUserInput(int,int)), this, SIGNAL(needUserInput(int,int)));
    // Received a dummy response
    QObject::connect(newIncommingConnection, SIGNAL(receivedDummy()), this, SIGNAL(receivedDummy()));
    // Connection is stable
    QObject::connect(newIncommingConnection, SIGNAL(receivedIP(int,QString)), this, SIGNAL(receivedIP(int,QString)));
    // Connection is reconnecting
    QObject::connect(newIncommingConnection, SIGNAL(receivedReconnect(int)), this, SIGNAL(receivedReconnect(int)));
    // Tap install controll
    QObject::connect(newIncommingConnection, SIGNAL(receivedTapControl(int)), this, SIGNAL(receivedTapControl(int)));
    // Tap remove controll
    QObject::connect(newIncommingConnection, SIGNAL(receivedRemoveTap(QString)), this, SIGNAL(receivedRemoveTap(QString)));

    QObject::connect(newIncommingConnection, SIGNAL(receivedTapCount(int)), this, SIGNAL(receivedTapCount(int)));

    // Received a status
    QObject::connect(newIncommingConnection, SIGNAL(receivedStatus(int,bool,bool,int,QString)), this, SIGNAL(receivedStatus(int,bool,bool,int,QString)));

    // Start thread now
    newIncommingConnection->start(QThread::NormalPriority);
}