net: convert standalone IsSelectableSocket() to Sock::IsSelectable()

This makes the callers mockable.
This commit is contained in:
Vasil Dimov
2021-04-13 14:29:14 +02:00
parent 5db7d2ca0a
commit b4bac55679
7 changed files with 30 additions and 10 deletions

View File

@@ -503,7 +503,7 @@ std::unique_ptr<Sock> CreateSockTCP(const CService& address_family)
// Ensure that waiting for I/O on this socket won't result in undefined
// behavior.
if (!IsSelectableSocket(sock->Get())) {
if (!sock->IsSelectable()) {
LogPrintf("Cannot create connection: non-selectable socket created (fd >= FD_SETSIZE ?)\n");
return nullptr;
}