0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd::net: Save listener opts and add accessor.

This commit is contained in:
Jason Volk 2018-08-29 15:50:55 -07:00
parent c2ae61093a
commit fcb5965e45
3 changed files with 25 additions and 0 deletions

View file

@ -25,6 +25,7 @@ struct ircd::net::listener::acceptor
static conf::item<milliseconds> timeout;
std::string name;
std::string opts;
size_t backlog;
listener::callback cb;
asio::ssl::context ssl;

View file

@ -28,6 +28,8 @@ struct ircd::net::listener
std::shared_ptr<struct acceptor> acceptor;
public:
explicit operator json::object() const;
listener(const string_view &name,
const json::object &options,
callback);
@ -54,6 +56,8 @@ struct ircd::net::listener_udp
std::unique_ptr<struct acceptor> acceptor;
public:
explicit operator json::object() const;
datagram &operator()(datagram &);
listener_udp(const string_view &name,

View file

@ -933,6 +933,14 @@ noexcept
acceptor->join();
}
ircd::net::listener::operator
ircd::json::object()
const
{
assert(acceptor);
return acceptor->opts;
}
//
// listener_udp
//
@ -980,6 +988,14 @@ ircd::net::listener_udp::operator()(datagram &datagram)
return acceptor->operator()(datagram);
}
ircd::net::listener_udp::operator
ircd::json::object()
const
{
assert(acceptor);
return acceptor->opts;
}
///////////////////////////////////////////////////////////////////////////////
//
// net/acceptor.h
@ -1021,6 +1037,10 @@ try
{
name
}
,opts
{
opts
}
,backlog
{
//TODO: XXX