void Connection::init() { connect(this, SIGNAL(connected()), SLOT(handshake())); connect(this, SIGNAL(readyRead()), SLOT(onDataReady())); connect(this, SIGNAL(encrypted()), SLOT(onEncrypted())); connect(this, SIGNAL(sslErrors(const QList<QSslError>&)), SLOT(onSslErrors(const QList<QSslError>&))); connect(this, SIGNAL(bytesWritten(qint64)), SLOT(sendNext(qint64))); }
DeviceAgent::DeviceAgent(QObject *parent): QSslSocket(parent) { connect(this,SIGNAL(readyRead()),this,SLOT(onDataComing())); connect(this, SIGNAL(disconnected()), this, SLOT(onDeviceDisconnected())); connect(this, SIGNAL(encrypted()), this, SLOT(onEncrypted())); connect(this, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(onSslErrors(QList<QSslError>))); m_dataPos = 0; }