diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2020-12-04 15:10:09 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2021-03-01 13:22:17 +0100 |
commit | 34bcfab562bac9887ca9c3831cf4fd0ee7f98149 (patch) | |
tree | 228081518170d88fff2559c53e5fce172bfdf432 /src/util | |
parent | cff65c4a270887ec171293409ab84f5d0d0be7fc (diff) |
net: move the constant maxWait out of InterruptibleRecv()
Move `maxWait` out of `InterruptibleRecv()` and rename it to
`MAX_WAIT_FOR_IO` so that it can be reused by other code.
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/sock.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util/sock.h b/src/util/sock.h index 26fe60f18f..23c3c35dad 100644 --- a/src/util/sock.h +++ b/src/util/sock.h @@ -6,11 +6,18 @@ #define BITCOIN_UTIL_SOCK_H #include <compat.h> +#include <util/time.h> #include <chrono> #include <string> /** + * Maximum time to wait for I/O readiness. + * It will take up until this time to break off in case of an interruption. + */ +static constexpr auto MAX_WAIT_FOR_IO = 1s; + +/** * RAII helper class that manages a socket. Mimics `std::unique_ptr`, but instead of a pointer it * contains a socket and closes it automatically when it goes out of scope. */ |