summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <freddy77@gmail.com>2020-06-05 07:33:28 +0100
committerFrediano Ziglio <freddy77@gmail.com>2020-06-08 09:05:28 +0100
commit3c74601652a732af14412d5983792d83f8031a85 (patch)
treec4937b6799d763cb7ec7d82e40f408bec3a528d7
parent64435c89348fd73801135038f80cf933474299a1 (diff)
main-channel-client: Make some members const
Also use a more explicit return type. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
-rw-r--r--server/main-channel-client.cpp10
-rw-r--r--server/main-channel-client.h10
2 files changed, 10 insertions, 10 deletions
diff --git a/server/main-channel-client.cpp b/server/main-channel-client.cpp
index f5b5fbb9..6c0a8200 100644
--- a/server/main-channel-client.cpp
+++ b/server/main-channel-client.cpp
@@ -541,23 +541,23 @@ MainChannelClient *main_channel_client_create(MainChannel *main_chan, RedClient
return mcc.get();
}
-int MainChannelClient::is_network_info_initialized()
+bool MainChannelClient::is_network_info_initialized() const
{
return priv->net_test_stage == NET_TEST_STAGE_COMPLETE;
}
-int MainChannelClient::is_low_bandwidth()
+bool MainChannelClient::is_low_bandwidth() const
{
// TODO: configurable?
return priv->bitrate_per_sec < 10 * 1024 * 1024;
}
-uint64_t MainChannelClient::get_bitrate_per_sec()
+uint64_t MainChannelClient::get_bitrate_per_sec() const
{
return priv->bitrate_per_sec;
}
-uint64_t MainChannelClient::get_roundtrip_ms()
+uint64_t MainChannelClient::get_roundtrip_ms() const
{
return priv->latency / 1000;
}
@@ -600,7 +600,7 @@ void MainChannelClient::connect_seamless()
priv->mig_connect_ok = FALSE;
}
-uint32_t MainChannelClient::get_connection_id()
+uint32_t MainChannelClient::get_connection_id() const
{
return priv->connection_id;
}
diff --git a/server/main-channel-client.h b/server/main-channel-client.h
index 4f040166..59324669 100644
--- a/server/main-channel-client.h
+++ b/server/main-channel-client.h
@@ -58,15 +58,15 @@ public:
* return TRUE if network test had been completed successfully.
* If FALSE, bitrate_per_sec is set to MAX_UINT64 and the roundtrip is set to 0
*/
- int is_network_info_initialized();
- int is_low_bandwidth();
- uint64_t get_bitrate_per_sec();
- uint64_t get_roundtrip_ms();
+ bool is_network_info_initialized() const;
+ bool is_low_bandwidth() const;
+ uint64_t get_bitrate_per_sec() const;
+ uint64_t get_roundtrip_ms() const;
void push_name(const char *name);
void push_uuid(const uint8_t uuid[16]);
- uint32_t get_connection_id();
+ uint32_t get_connection_id() const;
MainChannelClient(MainChannel *channel,
RedClient *client,