mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd::net: Add listener::name() interface method.
This commit is contained in:
parent
e5f94ed704
commit
60b3cd828e
2 changed files with 18 additions and 0 deletions
|
@ -29,6 +29,7 @@ struct ircd::net::listener
|
|||
|
||||
public:
|
||||
explicit operator json::object() const;
|
||||
string_view name() const;
|
||||
|
||||
listener(const string_view &name,
|
||||
const json::object &options,
|
||||
|
@ -57,6 +58,7 @@ struct ircd::net::listener_udp
|
|||
|
||||
public:
|
||||
explicit operator json::object() const;
|
||||
string_view name() const;
|
||||
|
||||
datagram &operator()(datagram &);
|
||||
|
||||
|
|
16
ircd/net.cc
16
ircd/net.cc
|
@ -933,6 +933,14 @@ noexcept
|
|||
acceptor->join();
|
||||
}
|
||||
|
||||
ircd::string_view
|
||||
ircd::net::listener::name()
|
||||
const
|
||||
{
|
||||
assert(acceptor);
|
||||
return acceptor->name;
|
||||
}
|
||||
|
||||
ircd::net::listener::operator
|
||||
ircd::json::object()
|
||||
const
|
||||
|
@ -988,6 +996,14 @@ ircd::net::listener_udp::operator()(datagram &datagram)
|
|||
return acceptor->operator()(datagram);
|
||||
}
|
||||
|
||||
ircd::string_view
|
||||
ircd::net::listener_udp::name()
|
||||
const
|
||||
{
|
||||
assert(acceptor);
|
||||
return acceptor->name;
|
||||
}
|
||||
|
||||
ircd::net::listener_udp::operator
|
||||
ircd::json::object()
|
||||
const
|
||||
|
|
Loading…
Reference in a new issue