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