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:
Vasil Dimov
2021-05-04 16:24:57 +02:00
parent cc74459768
commit ae263460ba
5 changed files with 152 additions and 50 deletions

View File

@@ -72,6 +72,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;
};