diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2021-05-04 16:24:57 +0200 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2022-06-09 14:20:18 +0200 |
commit | ae263460bab9e6aa112dc99790c8ef06a56ec838 (patch) | |
tree | 5b8135a48a7ce36b9c5cef68d2b26989577315fd /src/test/util | |
parent | cc74459768063a923fb6220a4f420eaf211aee7b (diff) | |
download | bitcoin-ae263460bab9e6aa112dc99790c8ef06a56ec838.tar.xz |
net: introduce Sock::WaitMany()
It allows waiting concurrently on more than one socket. Being a
`virtual` `Sock` method it can be overriden by tests.
Will be used to replace `CConnman::SocketEvents()`.
Diffstat (limited to 'src/test/util')
-rw-r--r-- | src/test/util/net.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/util/net.h b/src/test/util/net.h index e980fe4967..37d278645a 100644 --- a/src/test/util/net.h +++ b/src/test/util/net.h @@ -162,6 +162,15 @@ public: return true; } + bool WaitMany(std::chrono::milliseconds timeout, EventsPerSock& events_per_sock) const override + { + for (auto& [sock, events] : events_per_sock) { + (void)sock; + events.occurred = events.requested; + } + return true; + } + private: const std::string m_contents; mutable size_t m_consumed; |