mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
- The first part
- Added CodeDocs config file for customization - Fixing LGTM alerts - LGTM bug fixed again - added token option to hyperion-remote - fix DBManager::getDB() - next bugfix - correct broken signal from SettingManager to Hyperion - Token list is created after the schema is fetched Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
@@ -8,20 +8,24 @@
|
||||
#include <hyperion/Hyperion.h>
|
||||
#include "HyperionConfig.h"
|
||||
|
||||
// utils includes
|
||||
#include <utils/NetOrigin.h>
|
||||
|
||||
// qt includes
|
||||
#include <QUdpSocket>
|
||||
#include <QJsonObject>
|
||||
|
||||
using namespace hyperion;
|
||||
|
||||
UDPListener::UDPListener(const QJsonDocument& config) :
|
||||
QObject(),
|
||||
_server(new QUdpSocket(this)),
|
||||
_priority(0),
|
||||
_timeout(0),
|
||||
_log(Logger::getInstance("UDPLISTENER")),
|
||||
_isActive(false),
|
||||
_listenPort(0)
|
||||
UDPListener::UDPListener(const QJsonDocument& config)
|
||||
: QObject()
|
||||
, _server(new QUdpSocket(this))
|
||||
, _priority(0)
|
||||
, _timeout(0)
|
||||
, _log(Logger::getInstance("UDPLISTENER"))
|
||||
, _isActive(false)
|
||||
, _listenPort(0)
|
||||
, _netOrigin(NetOrigin::getInstance())
|
||||
{
|
||||
// listen for component change
|
||||
connect(Hyperion::getInstance(), &Hyperion::componentStateChanged, this, &UDPListener::componentStateChanged);
|
||||
@@ -116,7 +120,9 @@ void UDPListener::readPendingDatagrams()
|
||||
quint16 senderPort;
|
||||
|
||||
_server->readDatagram(datagram.data(), datagram.size(), &sender, &senderPort);
|
||||
processTheDatagram(&datagram, &sender);
|
||||
|
||||
if(_netOrigin->accessAllowed(sender, _listenAddress))
|
||||
processTheDatagram(&datagram, &sender);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user