1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 18:15:45 -05:00

SDRdaemonFEC plugin: UDP connect before bind

This commit is contained in:
f4exb 2017-02-03 08:20:53 +01:00
parent 1db62fd347
commit 91cb2c39f5
2 changed files with 9 additions and 6 deletions

View File

@ -27,7 +27,7 @@
const PluginDescriptor SDRdaemonFECPlugin::m_pluginDescriptor = {
QString("SDRdaemon with FEC input"),
QString("3.0.0"),
QString("3.2.0"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -74,17 +74,19 @@ void SDRdaemonFECUDPHandler::start()
m_dataSocket = new QUdpSocket(this);
}
if (!m_dataConnected)
if (!m_dataConnected)
{
if (m_dataSocket->bind(m_dataAddress, m_dataPort))
connect(m_dataSocket, SIGNAL(readyRead()), this, SLOT(dataReadyRead()), Qt::QueuedConnection); // , Qt::QueuedConnection
if (m_dataSocket->bind(m_dataAddress, m_dataPort))
{
qDebug("SDRdaemonFECUDPHandler::start: bind data socket to %s:%d", m_dataAddress.toString().toStdString().c_str(), m_dataPort);
connect(m_dataSocket, SIGNAL(readyRead()), this, SLOT(dataReadyRead()), Qt::QueuedConnection); // , Qt::QueuedConnection
m_dataConnected = true;
}
else
{
qWarning("SDRdaemonFECUDPHandler::start: cannot bind data port %d", m_dataPort);
disconnect(m_dataSocket, SIGNAL(readyRead()), this, SLOT(dataReadyRead()));
m_dataConnected = false;
}
}
@ -99,9 +101,10 @@ void SDRdaemonFECUDPHandler::stop()
{
qDebug("SDRdaemonFECUDPHandler::stop");
if (m_dataConnected) {
disconnect(m_dataSocket, SIGNAL(readyRead()), this, SLOT(dataReadyRead()));
if (m_dataConnected)
{
m_dataConnected = false;
disconnect(m_dataSocket, SIGNAL(readyRead()), this, SLOT(dataReadyRead()));
}
if (m_dataSocket)