0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd:Ⓜ️ Expose an init::close() for ircd::main() to stop listening.

This commit is contained in:
Jason Volk 2018-05-14 17:24:34 -07:00
parent 47b28d9295
commit 48f4c22cce
3 changed files with 9 additions and 0 deletions

View file

@ -99,6 +99,8 @@ struct ircd::m::init
static void bootstrap(); static void bootstrap();
void close();
public: public:
init(); init();
~init() noexcept; ~init() noexcept;

View file

@ -205,6 +205,7 @@ noexcept try
// Any deinits which have to be done with all subsystems intact // Any deinits which have to be done with all subsystems intact
const unwind shutdown{[&] const unwind shutdown{[&]
{ {
_matrix_.close();
_server_.interrupt(); _server_.interrupt();
_client_.interrupt(); _client_.interrupt();
_server_.close(); _server_.close();

View file

@ -102,6 +102,12 @@ catch(const m::error &e)
ircd::terminate(); ircd::terminate();
} }
void
ircd::m::init::close()
{
listeners.reset(nullptr);
}
ircd::m::init::modules::modules(const json::object &config) ircd::m::init::modules::modules(const json::object &config)
try try
{ {