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

ircd::net/ircd::server: Rename misleading functions.

This commit is contained in:
Jason Volk 2018-02-26 22:49:44 -08:00
parent b555e3f446
commit 7f77c68232
4 changed files with 23 additions and 23 deletions

View file

@ -47,7 +47,7 @@ namespace ircd::net
namespace ircd::net
{
bool connected(const socket &) noexcept;
bool opened(const socket &) noexcept;
size_t readable(const socket &);
size_t available(const socket &) noexcept;
ipport local_ipport(const socket &) noexcept;

View file

@ -50,7 +50,7 @@ struct ircd::server::link
size_t tag_commit_max() const;
// indicator lights
bool connected() const noexcept;
bool opened() const noexcept;
bool ready() const;
bool busy() const;

View file

@ -97,7 +97,7 @@ ircd::net::readable(const socket &socket)
}
bool
ircd::net::connected(const socket &socket)
ircd::net::opened(const socket &socket)
noexcept try
{
const ip::tcp::socket &sd(socket);
@ -1261,7 +1261,7 @@ ircd::net::socket::socket(asio::ssl::context &ssl,
ircd::net::socket::~socket()
noexcept try
{
if(unlikely(RB_DEBUG_LEVEL && connected(*this)))
if(unlikely(RB_DEBUG_LEVEL && opened(*this)))
throw assertive
{
"Failed to ensure socket(%p) is disconnected from %s before dtor.",
@ -1978,20 +1978,6 @@ catch(const std::exception &e)
e.what());
}
boost::asio::ip::tcp::endpoint
ircd::net::socket::local()
const
{
return sd.local_endpoint();
}
boost::asio::ip::tcp::endpoint
ircd::net::socket::remote()
const
{
return sd.remote_endpoint();
}
ircd::milliseconds
ircd::net::socket::cancel_timeout()
noexcept
@ -2037,6 +2023,20 @@ ircd::net::socket::set_timeout(const milliseconds &t,
timer.async_wait(std::move(handler));
}
boost::asio::ip::tcp::endpoint
ircd::net::socket::local()
const
{
return sd.local_endpoint();
}
boost::asio::ip::tcp::endpoint
ircd::net::socket::remote()
const
{
return sd.remote_endpoint();
}
ircd::net::socket::operator
SSL &()
{

View file

@ -656,7 +656,7 @@ void
ircd::server::node::del(link &link)
{
assert(!link.tag_count());
assert(!link.connected());
assert(!link.opened());
const auto it(std::find_if(begin(links), end(links), [&link]
(const auto &link_)
{
@ -895,7 +895,7 @@ ircd::server::link::~link()
noexcept
{
assert(!busy());
assert(!connected());
assert(!opened());
}
void
@ -1433,14 +1433,14 @@ bool
ircd::server::link::ready()
const
{
return connected() && !init && !fini;
return opened() && !init && !fini;
}
bool
ircd::server::link::connected()
ircd::server::link::opened()
const noexcept
{
return bool(socket) && net::connected(*socket);
return bool(socket) && net::opened(*socket);
}
size_t