diff options
author | Pierre Ossman <ossman@cendio.se> | 2015-12-13 15:43:46 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2017-11-17 08:23:07 +0100 |
commit | a99d14d1939cb2338b6268d9aebe3850df66daed (patch) | |
tree | fe6882d055923a03c5bc010b13045cb556a6c8e4 /common/rfb/util.h | |
parent | c09e5580d1058718301fe83fdb8750cc579e7ea1 (diff) | |
download | tigervnc-a99d14d1939cb2338b6268d9aebe3850df66daed.tar.gz tigervnc-a99d14d1939cb2338b6268d9aebe3850df66daed.zip |
Improved congestion control handling
Refine the previous method by interpolating the values we need.
This reduces the effect of the problem that we cannot send enough
ping packets.
Diffstat (limited to 'common/rfb/util.h')
-rw-r--r-- | common/rfb/util.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/rfb/util.h b/common/rfb/util.h index e9114c3d..3ca92f9d 100644 --- a/common/rfb/util.h +++ b/common/rfb/util.h @@ -95,9 +95,17 @@ namespace rfb { return (secs < 0 || secs > (INT_MAX/1000) ? INT_MAX : secs * 1000); } + // Returns time elapsed between two moments in milliseconds. + unsigned msBetween(const struct timeval *first, + const struct timeval *second); + // Returns time elapsed since given moment in milliseconds. unsigned msSince(const struct timeval *then); + // Returns true if first happened before seconds + bool isBefore(const struct timeval *first, + const struct timeval *second); + size_t siPrefix(long long value, const char *unit, char *buffer, size_t maxlen, int precision=6); size_t iecPrefix(long long value, const char *unit, |