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 is a partial backport of core#24356
https://github.com/bitcoin/bitcoin/pull/24356/commits/ae263460bab9e6aa112dc99790c8ef06a56ec838
Depends on D17132