Add network interface selection combo box widget to message_aggregator

This commit is contained in:
Bill Somerville
2020-11-03 20:31:11 +00:00
parent 1d9dd7df24
commit ced3b523ea
6 changed files with 101 additions and 20 deletions
+6 -4
View File
@@ -5,7 +5,6 @@
#include <QNetworkInterface>
#include <QUdpSocket>
#include <QString>
#include <QTimer>
#include <QHash>
@@ -78,7 +77,7 @@ public:
QString version_;
QString revision_;
QHostAddress multicast_group_address_;
QStringList network_interfaces_;
QSet<QString> network_interfaces_;
static BindMode constexpr bind_mode_ = ShareAddress | ReuseAddressHint;
struct Client
{
@@ -433,9 +432,12 @@ MessageServer::MessageServer (QObject * parent, QString const& version, QString
}
void MessageServer::start (port_type port, QHostAddress const& multicast_group_address
, QStringList const& network_interface_names)
, QSet<QString> const& network_interface_names)
{
if (port != m_->localPort () || multicast_group_address != m_->multicast_group_address_)
qDebug () << "MessageServer::start port:" << port << "multicast addr:" << multicast_group_address.toString () << "network interfaces:" << network_interface_names;
if (port != m_->localPort ()
|| multicast_group_address != m_->multicast_group_address_
|| network_interface_names != m_->network_interfaces_)
{
m_->leave_multicast_group ();
if (impl::UnconnectedState != m_->state ())