mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +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:
parent
5c82ca3365
commit
5db7d2ca0a
3 changed files with 10 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue