QAbstractSocket
throws UnsupportedSocketOperationError
when connecting to a host over QSslSocket::connectToHostEncrypted()
,
Environnement: Qt 5.9.3 Ubuntu 16.04 (virtual machine) also Qt 5.9.3 Fedora 26 (native)
_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
}
Can you please help me?
I don't understand the error and why it is happening?