Added / prepared for state disconnecting:

Taking up the idea of MS (disconnecting),
and based on a real world issue where the transition state
of disconnecting was still handled as connected.
This commit is contained in:
Klaus Basan
2014-02-04 14:14:32 +01:00
committed by Mathew Sutcliffe
parent 34c75c7505
commit 79f5b6fcd3
3 changed files with 6 additions and 1 deletions

View File

@@ -88,6 +88,7 @@ namespace BlackCore
enum ConnectionStatus
{
Disconnected = 0, //!< Not connected
Disconnecting, //!< In transition to disconnected
DisconnectedError, //!< Disconnected due to socket error
Connecting, //!< Connection initiated but not established
Connected //!< Connection established

View File

@@ -343,6 +343,8 @@ namespace BlackCore
if (m_net && m_net->IsValid() && m_net->IsNetworkConnected())
{
// I let others know we are going down
emit this->connectionStatusChanged(convertConnectionStatus(m_status), Disconnecting);
m_net->LogoffAndDisconnect(c_logoffTimeoutSec);
}
}
@@ -788,7 +790,7 @@ namespace BlackCore
case Cvatlib_Network::error_NoFP: msg = "Server: no flight plan"; break;
case Cvatlib_Network::error_NoWeather: msg = "Server: requested weather profile does not exist"; break;
// we have no idea what these mean
// we have no idea what these mean
case Cvatlib_Network::error_Registered:
case Cvatlib_Network::error_InvalidControl: msg = "Server: "; msg.append(cbvar_cast(cbvar)->fromFSD(msgData)); break;