|
|
@ -51,6 +51,7 @@ MicrohardHandler::_start(uint16_t port, QHostAddress addr) |
|
|
|
QObject::connect(_tcpSocket, &QIODevice::readyRead, this, &MicrohardHandler::_readBytes); |
|
|
|
QObject::connect(_tcpSocket, &QIODevice::readyRead, this, &MicrohardHandler::_readBytes); |
|
|
|
qCDebug(MicrohardLog) << "Connecting to" << addr; |
|
|
|
qCDebug(MicrohardLog) << "Connecting to" << addr; |
|
|
|
_tcpSocket->connectToHost(addr, port); |
|
|
|
_tcpSocket->connectToHost(addr, port); |
|
|
|
|
|
|
|
//-- TODO: This has to be removed. It's blocking the main thread.
|
|
|
|
if (!_tcpSocket->waitForConnected(1000)) { |
|
|
|
if (!_tcpSocket->waitForConnected(1000)) { |
|
|
|
emit connected(0); |
|
|
|
emit connected(0); |
|
|
|
close(); |
|
|
|
close(); |
|
|
|