QAbstractSocket
上连接主机时 UnsupportedSocketOperationError
抛出QSslSocket::connectToHostEncrypted()
,
Environnement: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
}
你能帮帮我吗?
我不明白错误及其发生的原因?