0

QAbstractSocketUnsupportedSocketOperationError连接到主机时抛出QSslSocket::connectToHostEncrypted()

环境:Qt 5.9.3 Ubuntu 16.04(虚拟机)和 Qt 5.9.3 Fedora 26(本机)

_socket = new QSslSocket{this};
connect(_socket, static_cast<void(QAbstractSocket::*) QAbstractSocket::SocketError) (&QAbstractSocket::error), this, &EventResource::streamError);

_socket->connectToHostEncrypted(_device->addressUrl().host(), 443, QSslSocket::ReadWrite, QSslSocket::IPv4Protocol);

void EventResource::streamError(QAbstractSocket::SocketError error)
{
    QDebug() << "Event error: " << error; 
    //QAbstractSocket::UnsupportedSocketOperationError
}

你能帮我么?
我不明白错误以及为什么会发生?

4

0 回答 0