mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-29 18:05:58 +02:00
moveonly: move IsSelectableSocket() from compat.h to sock.{h,cpp}
To be converted to a method of the `Sock` class.
This commit is contained in:
@@ -117,6 +117,14 @@ int Sock::GetSockName(sockaddr* name, socklen_t* name_len) const
|
||||
return getsockname(m_socket, name, name_len);
|
||||
}
|
||||
|
||||
bool IsSelectableSocket(const SOCKET& s) {
|
||||
#if defined(USE_POLL) || defined(WIN32)
|
||||
return true;
|
||||
#else
|
||||
return (s < FD_SETSIZE);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Sock::Wait(std::chrono::milliseconds timeout, Event requested, Event* occurred) const
|
||||
{
|
||||
// We need a `shared_ptr` owning `this` for `WaitMany()`, but don't want
|
||||
|
||||
Reference in New Issue
Block a user