mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
ircd::net: Add remote to hostport conversion.
This commit is contained in:
parent
02dc5204c9
commit
f02c31217b
1 changed files with 8 additions and 0 deletions
|
@ -46,6 +46,7 @@ struct ircd::net::remote
|
|||
std::string hostname;
|
||||
|
||||
explicit operator bool() const;
|
||||
operator hostport() const;
|
||||
bool operator!() const { return !static_cast<bool>(*this); }
|
||||
bool resolved() const;
|
||||
|
||||
|
@ -70,6 +71,13 @@ const
|
|||
return bool(static_cast<const ipport &>(*this));
|
||||
}
|
||||
|
||||
inline ircd::net::remote::operator
|
||||
hostport()
|
||||
const
|
||||
{
|
||||
return { hostname, port(*this) };
|
||||
}
|
||||
|
||||
inline ircd::net::remote::operator
|
||||
bool()
|
||||
const
|
||||
|
|
Loading…
Reference in a new issue