本文整理汇总了C++中QSslSocket::mode方法的典型用法代码示例。如果您正苦于以下问题:C++ QSslSocket::mode方法的具体用法?C++ QSslSocket::mode怎么用?C++ QSslSocket::mode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSslSocket
的用法示例。
在下文中一共展示了QSslSocket::mode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: encrypted
void LanLinkProvider::encrypted()
{
qCDebug(KDECONNECT_CORE) << "Socket succesfully stablished an SSL connection";
QSslSocket* socket = qobject_cast<QSslSocket*>(sender());
if (!socket) return;
disconnect(socket, &QSslSocket::encrypted, this, &LanLinkProvider::encrypted);
disconnect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>)));
Q_ASSERT(socket->mode() != QSslSocket::UnencryptedMode);
LanDeviceLink::ConnectionStarted connectionOrigin = (socket->mode() == QSslSocket::SslClientMode)? LanDeviceLink::Locally : LanDeviceLink::Remotely;
NetworkPackage* receivedPackage = receivedIdentityPackages[socket].np;
const QString& deviceId = receivedPackage->get<QString>(QStringLiteral("deviceId"));
addLink(deviceId, socket, receivedPackage, connectionOrigin);
// Copied from connected slot, now delete received package
delete receivedIdentityPackages.take(socket).np;
}