mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 22:45:41 +01:00
net: add new method Sock::Listen() that wraps listen()
This will help to increase `Sock` usage and make more code mockable.
This commit is contained in:
@@ -2408,7 +2408,7 @@ bool CConnman::BindListenPort(const CService& addrBind, bilingual_str& strError,
|
||||
LogPrintf("Bound to %s\n", addrBind.ToString());
|
||||
|
||||
// Listen for incoming connections
|
||||
if (listen(sock->Get(), SOMAXCONN) == SOCKET_ERROR)
|
||||
if (sock->Listen(SOMAXCONN) == SOCKET_ERROR)
|
||||
{
|
||||
strError = strprintf(_("Error: Listening for incoming connections failed (listen returned error %s)"), NetworkErrorString(WSAGetLastError()));
|
||||
LogPrintf("%s\n", strError.original);
|
||||
|
||||
Reference in New Issue
Block a user