コード例 #1
0
void QMyServer::_connectSocketSignals ()
{
    connect(socket, SIGNAL(encrypted()), this, SLOT(slot_encrypted()));
    connect(socket, SIGNAL(encryptedBytesWritten(qint64)),
            this, SLOT(slot_encryptedBytesWritten(qint64)));
    connect(socket, SIGNAL(modeChanged(QSslSocket::SslMode)),
            this, SLOT(slot_modeChanged(QSslSocket::SslMode)));
    connect(socket, SIGNAL(peerVerifyError(const QSslError &)),
            this, SLOT(slot_peerVerifyError (const QSslError &)));
    connect(socket, SIGNAL(sslErrors(const QList<QSslError> &)),
            this, SLOT(slot_sslErrors(const QList<QSslError> &)));
    connect(socket, SIGNAL(readyRead()),
            this, SLOT(slot_readyRead()));
    connect(socket, SIGNAL(connected()),
            this, SLOT(slot_connected()));
    connect(socket, SIGNAL(disconnected()),
            this, SLOT(slot_disconnected()));
    connect(socket, SIGNAL(error(QAbstractSocket::SocketError)),
            this, SLOT(slot_error(QAbstractSocket::SocketError)));
    connect(socket, SIGNAL(hostFound()),
            this, SLOT(slot_hostFound()));
    connect(socket, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *)),
            this, SLOT(slot_proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *)));
    connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
            this, SLOT(slot_stateChanged(QAbstractSocket::SocketState)));
}
コード例 #2
0
ファイル: srvcli.cpp プロジェクト: OldFrank/openvpn-client
SrvCLI::SrvCLI()
    : connectionIsOnline (false)
{
    QObject::connect (&this->sslSocket, SIGNAL(disconnected()), this, SLOT(connectionClosedByServer()));
    QObject::connect (&this->sslSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(error()));
    QObject::connect (&this->sslSocket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(slot_sslErrors(QList<QSslError>)));
    QObject::connect (&this->sslSocket, SIGNAL(peerVerifyError(QSslError)), this, SLOT(slot_peerVerifyError(QSslError)));
    QObject::connect (&this->sslSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(slot_stateChanged(QAbstractSocket::SocketState)));
}