mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
IPv6 support (#1369)
* hyperion-remote - Support IPv6 * LEDDevices - Remove IPv6 limitations * Separate JsonEditorHostValidation * Standalone grabbers & JSON/Flatbuffer forwarder: IPv6 support * remote: Fix setting multiple colors via Hex, add standard logging * IPv6 Updates -Add db migration activities * Addressing non-Windows compile issues * Code cleanup, address clang feedback * Update address (hostname, IPv4/IPv6) help text * Apply migration steps to "old" configurations imported * Show user the UI-Url, if hyperion is already running, address clang findings * Windows Cmake OpenSLL output * Minor Text update
This commit is contained in:
@@ -11,33 +11,21 @@
|
||||
#include "hyperion_reply_generated.h"
|
||||
#include "hyperion_request_generated.h"
|
||||
|
||||
FlatBufferConnection::FlatBufferConnection(const QString& origin, const QString & address, int priority, bool skipReply)
|
||||
FlatBufferConnection::FlatBufferConnection(const QString& origin, const QString& host, int priority, bool skipReply, quint16 port)
|
||||
: _socket()
|
||||
, _origin(origin)
|
||||
, _priority(priority)
|
||||
, _host(host)
|
||||
, _port(port)
|
||||
, _prevSocketState(QAbstractSocket::UnconnectedState)
|
||||
, _log(Logger::getInstance("FLATBUFCONN"))
|
||||
, _registered(false)
|
||||
{
|
||||
QStringList parts = address.split(":");
|
||||
if (parts.size() != 2)
|
||||
{
|
||||
throw std::runtime_error(QString("FLATBUFCONNECTION ERROR: Unable to parse address (%1)").arg(address).toStdString());
|
||||
}
|
||||
_host = parts[0];
|
||||
|
||||
bool ok;
|
||||
_port = parts[1].toUShort(&ok);
|
||||
if (!ok)
|
||||
{
|
||||
throw std::runtime_error(QString("FLATBUFCONNECTION ERROR: Unable to parse the port (%1)").arg(parts[1]).toStdString());
|
||||
}
|
||||
|
||||
if(!skipReply)
|
||||
connect(&_socket, &QTcpSocket::readyRead, this, &FlatBufferConnection::readData, Qt::UniqueConnection);
|
||||
|
||||
// init connect
|
||||
Info(_log, "Connecting to Hyperion: %s:%d", _host.toStdString().c_str(), _port);
|
||||
Info(_log, "Connecting to Hyperion: %s:%u", QSTRING_CSTR(_host), _port);
|
||||
connectToHost();
|
||||
|
||||
// start the connection timer
|
||||
@@ -167,13 +155,13 @@ void FlatBufferConnection::sendMessage(const uint8_t* buffer, uint32_t size)
|
||||
switch (_socket.state() )
|
||||
{
|
||||
case QAbstractSocket::UnconnectedState:
|
||||
Info(_log, "No connection to Hyperion: %s:%d", _host.toStdString().c_str(), _port);
|
||||
Info(_log, "No connection to Hyperion: %s:%u", QSTRING_CSTR(_host), _port);
|
||||
break;
|
||||
case QAbstractSocket::ConnectedState:
|
||||
Info(_log, "Connected to Hyperion: %s:%d", _host.toStdString().c_str(), _port);
|
||||
Info(_log, "Connected to Hyperion: %s:%u", QSTRING_CSTR(_host), _port);
|
||||
break;
|
||||
default:
|
||||
Debug(_log, "Connecting to Hyperion: %s:%d", _host.toStdString().c_str(), _port);
|
||||
Debug(_log, "Connecting to Hyperion: %s:%u", QSTRING_CSTR(_host), _port);
|
||||
break;
|
||||
}
|
||||
_prevSocketState = _socket.state();
|
||||
|
Reference in New Issue
Block a user