diff --git a/core/NetworkNotification.cpp b/core/NetworkNotification.cpp index 8c031be6..ce809128 100644 --- a/core/NetworkNotification.cpp +++ b/core/NetworkNotification.cpp @@ -1,5 +1,4 @@ #include -#include #include "NetworkNotification.h" #include "debug.h" @@ -251,17 +250,13 @@ void NetworkNotification::send(const QByteArray &data, const HostsPortString &de qCDebug(function_parameters) << QString(data); - if ( data.size() <= 0 ) - { + if ( data.isEmpty() ) return; - } const QList &addrList = dests.getAddrList(); for ( const HostPortAddress &addr : addrList ) { - QUdpSocket udpSocket; - qCDebug(runtime) << "Sending to " << addr; udpSocket.writeDatagram(data, addr, addr.getPort()); } diff --git a/core/NetworkNotification.h b/core/NetworkNotification.h index 8ee85680..da3e01e7 100644 --- a/core/NetworkNotification.h +++ b/core/NetworkNotification.h @@ -5,6 +5,8 @@ #include #include #include +#include + #include "core/HostsPortString.h" #include "logformat/LogFormat.h" #include "data/DxSpot.h" @@ -155,6 +157,8 @@ public slots: private: + QUdpSocket udpSocket; + void send(const QByteArray &, const HostsPortString &); static QString CONFIG_NOTIF_QSO_ADI_ADDRS_KEY;