mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 00:32:35 +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:
|
public:
|
||||||
explicit operator json::object() const;
|
explicit operator json::object() const;
|
||||||
|
string_view name() const;
|
||||||
|
|
||||||
listener(const string_view &name,
|
listener(const string_view &name,
|
||||||
const json::object &options,
|
const json::object &options,
|
||||||
|
@ -57,6 +58,7 @@ struct ircd::net::listener_udp
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit operator json::object() const;
|
explicit operator json::object() const;
|
||||||
|
string_view name() const;
|
||||||
|
|
||||||
datagram &operator()(datagram &);
|
datagram &operator()(datagram &);
|
||||||
|
|
||||||
|
|
16
ircd/net.cc
16
ircd/net.cc
|
@ -933,6 +933,14 @@ noexcept
|
||||||
acceptor->join();
|
acceptor->join();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::string_view
|
||||||
|
ircd::net::listener::name()
|
||||||
|
const
|
||||||
|
{
|
||||||
|
assert(acceptor);
|
||||||
|
return acceptor->name;
|
||||||
|
}
|
||||||
|
|
||||||
ircd::net::listener::operator
|
ircd::net::listener::operator
|
||||||
ircd::json::object()
|
ircd::json::object()
|
||||||
const
|
const
|
||||||
|
@ -988,6 +996,14 @@ ircd::net::listener_udp::operator()(datagram &datagram)
|
||||||
return acceptor->operator()(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::net::listener_udp::operator
|
||||||
ircd::json::object()
|
ircd::json::object()
|
||||||
const
|
const
|
||||||
|
|
Loading…
Reference in a new issue