0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 02:02:38 +01:00

ircd::net: Simplify socket check related.

This commit is contained in:
Jason Volk 2019-07-27 13:17:34 -07:00
parent 9391ee38f4
commit 63a9f33d7c
2 changed files with 10 additions and 14 deletions

View file

@ -100,7 +100,6 @@ struct ircd::net::socket
// low level check suite
error_code check(std::nothrow_t, const ready &) noexcept;
void check(const ready &);
// low level wait suite
void wait(const wait_opts &);

View file

@ -471,7 +471,16 @@ void
ircd::net::check(socket &socket,
const ready &type)
{
socket.check(type);
const error_code ec
{
check(std::nothrow, socket, type)
};
if(likely(!ec))
return;
throw_system_error(ec);
__builtin_unreachable();
}
std::error_code
@ -3142,18 +3151,6 @@ catch(const boost::system::system_error &e)
throw_system_error(e);
}
void
ircd::net::socket::check(const ready &type)
{
const error_code ec
{
check(std::nothrow, type)
};
if(ec.value())
throw_system_error(ec);
}
std::error_code
ircd::net::socket::check(std::nothrow_t,
const ready &type)