Introduces a new low-level socket manager SockMan
as an abstract class with virtual functions for implementing higher-level networking protocols like HTTP. This is the next step in #31194
This is a minimal, alternative version of #30988 (“Split CConnman”) without any changes to working code (P2P is not affected). It adds a stripped-down version of the SockMan
introduced in that pull request that implements only what is needed for the HTTP server implemented in #32061 (i.e. no I2P stuff and for now, no outbound connection stuff). Exclusions from the original SockMan
pull request can be checked with:
0git diff vasild/sockman \
1src/common/sockman.h \
2src/common/sockman.cpp
The commit order has been flipped quite a bit because the original PR incrementally pulls logic out of net
wheras this PR builds a new system from the bottom-up. Otherwise I tried to keep all the SockMan
code in order so reviewers of the original PR would be familiar with it.
It also adds unit tests by introducing a SocketTestingSetup
which mocks network sockets by returning a queue of DynSock
from CreateSock()
. HTTP server tests in #32061 will be rebased on this framework as well.