mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-09 12:12:41 +01:00
Merge bitcoin/bitcoin#24356: refactor: replace CConnman::SocketEvents() with mockable Sock::WaitMany()
6e68ccbefenet: use Sock::WaitMany() instead of CConnman::SocketEvents() (Vasil Dimov)ae263460banet: introduce Sock::WaitMany() (Vasil Dimov)cc74459768net: also wait for exceptional events in Sock::Wait() (Vasil Dimov) Pull request description: _This is a piece of #21878, chopped off to ease review._ `Sock::Wait()` waits for IO events on one socket. Introduce a similar `virtual` method `WaitMany()` that waits simultaneously for IO events on more than one socket. Use `WaitMany()` instead of `CConnman::SocketEvents()` (and ditch the latter). Given that the former is a `virtual` method, it can be mocked by unit and fuzz tests. This will help to make bigger parts of `CConnman` testable (unit and fuzz). ACKs for top commit: laanwj: Code review ACK6e68ccbefejonatack: re-ACK6e68ccbefeper `git range-diffe18fd476747729 6e68ccb`, and verified rebase to master and debug build Tree-SHA512: 917fb6ad880d64d3af1ebb301c06fbd01afd8ff043f49e4055a088ebed6affb7ffe1dcf59292d822f10de5f323b6d52d557cb081dd7434634995f9148efcf08f
This commit is contained in:
@@ -71,6 +71,8 @@ public:
|
||||
|
||||
bool Wait(std::chrono::milliseconds timeout, Event requested, Event* occurred = nullptr) const override;
|
||||
|
||||
bool WaitMany(std::chrono::milliseconds timeout, EventsPerSock& events_per_sock) const override;
|
||||
|
||||
bool IsConnected(std::string& errmsg) const override;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user