@@ -32,14 +32,14 @@ namespace tcp {
3232// TODO: Appendix G. RTO Calculation Modification https://tools.ietf.org/html/rfc7323#appendix-G
3333struct RTTM {
3434 using milliseconds = std::chrono::milliseconds;
35- using seconds = std::chrono::duration<double >; // seconds as double
35+ using seconds = std::chrono::duration<float >; // seconds as float
3636
3737 // clock granularity
38- static constexpr double CLOCK_G {clock_granularity};
38+ static constexpr float CLOCK_G {clock_granularity};
3939
40- static constexpr double K = 4.0 ;
41- static constexpr double alpha = 1.0 / 8.0 ;
42- static constexpr double beta = 1.0 / 4.0 ;
40+ static constexpr float K = 4.0 ;
41+ static constexpr float alpha = 1.0 / 8.0 ;
42+ static constexpr float beta = 1.0 / 4.0 ;
4343
4444 seconds SRTT; // smoothed round-trip time
4545 seconds RTTVAR; // round-trip time variation
@@ -112,7 +112,7 @@ struct RTTM {
112112 // 1. A multiplier member could be added to be used for "backing off" the timer (return compute_rto() * multiplier).
113113 // 2. Dunno how to set RTO = 3s when timeout on ACK for SYN.
114114 seconds compute_rto () const
115- { return seconds{std::max (SRTT.count () + std::max (CLOCK_G, K * RTTVAR.count ()), 1.0 )}; }
115+ { return seconds{std::max (SRTT.count () + std::max (CLOCK_G, K * RTTVAR.count ()), 1 .0f )}; }
116116
117117 /* *
118118 * @brief Take a RTT (Round trip time) measurment
0 commit comments