diff --git a/src/net/SocketError.hxx b/src/net/SocketError.hxx index cca051c8e..3e98f4de3 100644 --- a/src/net/SocketError.hxx +++ b/src/net/SocketError.hxx @@ -146,6 +146,16 @@ IsSocketErrorClosed(socket_error_t code) noexcept #endif } +constexpr bool +IsSocketErrorTimeout(socket_error_t code) noexcept +{ +#ifdef _WIN32 + return code == WSAETIMEDOUT; +#else + return code == ETIMEDOUT; +#endif +} + /** * Helper class that formats a socket error message into a * human-readable string. On Windows, a buffer is necessary for this,