diff --git a/src/net/SocketError.hxx b/src/net/SocketError.hxx index 682a8911f..de81073e8 100644 --- a/src/net/SocketError.hxx +++ b/src/net/SocketError.hxx @@ -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