net/SocketError: add IsSocketError() overload with socket_error_t
This commit is contained in:
parent
314667259e
commit
75eb2c257c
|
@ -172,6 +172,13 @@ IsSocketError(const std::system_error &e) noexcept
|
|||
return e.code().category() == SocketErrorCategory();
|
||||
}
|
||||
|
||||
[[gnu::pure]]
|
||||
static inline bool
|
||||
IsSocketError(const std::system_error &e, socket_error_t code) noexcept
|
||||
{
|
||||
return IsSocketError(e) && e.code().value() == code;
|
||||
}
|
||||
|
||||
[[gnu::pure]]
|
||||
static inline bool
|
||||
IsSocketErrorReceiveWouldBlock(const std::system_error &e) noexcept
|
||||
|
|
Loading…
Reference in New Issue