constexpr auto THIRTY_SECONDS = std::chrono::seconds(30);
constexpr auto INIT_PKT_INTERVAL_DT = std::chrono::seconds(5);
-constexpr auto HEARTBEAT_PKT_INTERVAL_DT = std::chrono::milliseconds(150);
+constexpr unsigned int HEARTBEAT_PKT_INT_MIN_MILLIS = 150;
+constexpr unsigned int HEARTBEAT_PKT_INT_MAX_MILLIS = 5000;
+constexpr auto HEARTBEAT_PKT_INTERVAL_DT = std::chrono::milliseconds(HEARTBEAT_PKT_INT_MIN_MILLIS);
constexpr auto PACKET_TIMEOUT_TIME = ONE_SECOND;
constexpr auto GOOD_RTT_LIMIT = std::chrono::milliseconds(250);
constexpr auto CONNECTION_TIMEOUT = TEN_SECONDS;
int ret = 0;
- if (millis < 150) {
- millis = 150;
+ if (millis < UDPC::HEARTBEAT_PKT_INT_MIN_MILLIS) {
+ millis = UDPC::HEARTBEAT_PKT_INT_MIN_MILLIS;
ret = 1;
- } else if (millis > 5000) {
- millis = 5000;
+ } else if (millis > UDPC::HEARTBEAT_PKT_INT_MAX_MILLIS) {
+ millis = UDPC::HEARTBEAT_PKT_INT_MAX_MILLIS;
ret = 2;
}