From d1006160f8ffd735b7824945bad4c5d16d8a09fe Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 5 Oct 2019 01:38:55 +0200 Subject: [PATCH] Ref T730, style --- .../afv/connection/clientconnectiondata.cpp | 6 +++--- .../afv/connection/clientconnectiondata.h | 20 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/blackcore/afv/connection/clientconnectiondata.cpp b/src/blackcore/afv/connection/clientconnectiondata.cpp index 6b039304b..bc8b78a8a 100644 --- a/src/blackcore/afv/connection/clientconnectiondata.cpp +++ b/src/blackcore/afv/connection/clientconnectiondata.cpp @@ -24,7 +24,7 @@ namespace BlackCore bool CClientConnectionData::isVoiceServerAlive() const { - return m_lastVoiceServerHeartbeatAckUtc.secsTo(QDateTime::currentDateTimeUtc()) > serverTimeout; + return m_lastVoiceServerHeartbeatAckUtc.secsTo(QDateTime::currentDateTimeUtc()) > ServerTimeoutSecs; } void CClientConnectionData::createCryptoChannels() @@ -39,8 +39,8 @@ namespace BlackCore bool CClientConnectionData::voiceServerAlive() const { - return timeSinceAuthentication() < serverTimeout || - m_lastVoiceServerHeartbeatAckUtc.secsTo(QDateTime::currentDateTimeUtc()) < serverTimeout; + return timeSinceAuthentication() < ServerTimeoutSecs || + m_lastVoiceServerHeartbeatAckUtc.secsTo(QDateTime::currentDateTimeUtc()) < ServerTimeoutSecs; } } // ns } // ns diff --git a/src/blackcore/afv/connection/clientconnectiondata.h b/src/blackcore/afv/connection/clientconnectiondata.h index 727541e06..176cb3539 100644 --- a/src/blackcore/afv/connection/clientconnectiondata.h +++ b/src/blackcore/afv/connection/clientconnectiondata.h @@ -29,12 +29,16 @@ namespace BlackCore //! Client connection data struct CClientConnectionData { + //! Ctor CClientConnectionData() = default; + //! Time since authentication qint64 secondsSinceAuthentication() const; + //! Servers alive @{ bool isVoiceServerAlive() const; bool isDataServerAlive() const; + //! @} /* TODO public long VoiceServerBytesSent { get; set; } @@ -43,25 +47,25 @@ namespace BlackCore public long DataServerBytesReceived { get; set; } */ + //! Crypto channels for voice and data void createCryptoChannels(); qint64 timeSinceAuthentication() const { return m_authenticatedDateTimeUtc.secsTo(QDateTime::currentDateTimeUtc()); } bool voiceServerAlive() const; - QString m_userName; - QString m_callsign; + QString m_userName; //!< user name + QString m_callsign; //!< callsign - PostCallsignResponseDto m_tokens; - - QScopedPointer voiceCryptoChannel; + PostCallsignResponseDto m_tokens; //!< tokens + QScopedPointer voiceCryptoChannel; //!< used crypto channel QDateTime m_authenticatedDateTimeUtc; QDateTime m_lastVoiceServerHeartbeatAckUtc; - bool m_receiveAudio = true; - bool m_connected = false; + bool m_receiveAudio = true; //!< audio? + bool m_connected = false; //!< connected? - static constexpr qint64 serverTimeout = 10; + static constexpr qint64 ServerTimeoutSecs = 10; //!< timeout }; } // ns } // ns