event/net/UdpListener: use IsSocketErrorReceiveWouldBlock()

This commit is contained in:
Max Kellermann 2022-06-13 21:11:05 +02:00 committed by Max Kellermann
parent 8aa4227c0c
commit 2ba092711f

View File

@ -191,6 +191,14 @@ SocketErrorCategory() noexcept
#endif
}
[[gnu::pure]]
static inline bool
IsSocketErrorReceiveWouldBlock(const std::system_error &e) noexcept
{
return e.code().category() == SocketErrorCategory() &&
IsSocketErrorReceiveWouldBlock(e.code().value());
}
[[gnu::pure]]
static inline auto
MakeSocketError(socket_error_t code, const char *msg) noexcept