mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 17:54:19 +02:00
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()`.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user