int SslServerConnection::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QThread::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: connectionIsClosed(); break;
        case 1: slotAcceptedClient(); break;
        case 2: slotStartRead(); break;
        case 3: slotConnectionClosed(); break;
        case 4: slotError((*reinterpret_cast< QAbstractSocket::SocketError(*)>(_a[1]))); break;
        case 5: slotModeChanged((*reinterpret_cast< QSslSocket::SslMode(*)>(_a[1]))); break;
        case 6: removeItemFromList((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 7: recDig((*reinterpret_cast< int(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 8;
    }
    return _id;
}
示例#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);
}