Merge PR #505: Retry the connection if the discovery finds more URLs for a host afte…
This commit is contained in:
commit
5ad11f48df
@ -107,6 +107,7 @@ void NymeaConnection::setCurrentHost(NymeaHost *host)
|
|||||||
transport->deleteLater();
|
transport->deleteLater();
|
||||||
}
|
}
|
||||||
if (m_currentHost) {
|
if (m_currentHost) {
|
||||||
|
disconnect(m_currentHost, &NymeaHost::connectionChanged, this, &NymeaConnection::hostConnectionsUpdated);
|
||||||
m_currentHost = nullptr;
|
m_currentHost = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,6 +122,8 @@ void NymeaConnection::setCurrentHost(NymeaHost *host)
|
|||||||
|
|
||||||
qDebug() << "Nymea host is" << m_currentHost->name() << m_currentHost->uuid();
|
qDebug() << "Nymea host is" << m_currentHost->name() << m_currentHost->uuid();
|
||||||
|
|
||||||
|
connect(m_currentHost, &NymeaHost::connectionChanged, this, &NymeaConnection::hostConnectionsUpdated);
|
||||||
|
|
||||||
m_connectionStatus = ConnectionStatusConnecting;
|
m_connectionStatus = ConnectionStatusConnecting;
|
||||||
emit connectionStatusChanged();
|
emit connectionStatusChanged();
|
||||||
|
|
||||||
@ -394,6 +397,11 @@ void NymeaConnection::updateActiveBearers()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NymeaConnection::hostConnectionsUpdated()
|
||||||
|
{
|
||||||
|
connectInternal(m_currentHost);
|
||||||
|
}
|
||||||
|
|
||||||
void NymeaConnection::registerTransport(NymeaTransportInterfaceFactory *transportFactory)
|
void NymeaConnection::registerTransport(NymeaTransportInterfaceFactory *transportFactory)
|
||||||
{
|
{
|
||||||
foreach (const QString &scheme, transportFactory->supportedSchemes()) {
|
foreach (const QString &scheme, transportFactory->supportedSchemes()) {
|
||||||
|
|||||||
@ -120,6 +120,7 @@ private slots:
|
|||||||
void onDisconnected();
|
void onDisconnected();
|
||||||
|
|
||||||
void updateActiveBearers();
|
void updateActiveBearers();
|
||||||
|
void hostConnectionsUpdated();
|
||||||
private:
|
private:
|
||||||
void connectInternal(NymeaHost *host);
|
void connectInternal(NymeaHost *host);
|
||||||
bool connectInternal(Connection *connection);
|
bool connectInternal(Connection *connection);
|
||||||
|
|||||||
Reference in New Issue
Block a user