mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 01:33:20 +02:00
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.
This commit is contained in:
@@ -6,10 +6,17 @@
|
||||
#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.
|
||||
|
||||
Reference in New Issue
Block a user