From daec60320502d3eeb89ecae9fcffb3a0a0fbc793 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 3 Apr 2019 10:49:33 -0700 Subject: [PATCH] construct: Improve main function commentary etc. --- construct/construct.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/construct/construct.cc b/construct/construct.cc index 82613dfd7..7b8e23be9 100644 --- a/construct/construct.cc +++ b/construct/construct.cc @@ -129,10 +129,13 @@ try "Must specify the origin after any switched parameters." }; + // This is the sole io_context for Construct, and the ios.run() below is the + // the only place where the program actually blocks. + boost::asio::io_context ios; + // Associates libircd with our io_context and posts the initial routines // to that io_context. Execution of IRCd will then occur during ios::run() - // note: only supports service for one hostname at this time. - boost::asio::io_context ios; + // note: only supports service for one hostname/origin at this time. ircd::init(ios, origin, hostname); // libircd does no signal handling (or at least none that you ever have to @@ -144,11 +147,14 @@ try // platformness with windows etc. const construct::signals signals{ios}; - // If the user wants to immediately drop to a command line without having to - // send a ctrl-c for it, that is provided here. + // If the user wants to immediately drop to an interactive command line + // without having to send a ctrl-c for it, that is provided here. This does + // not actually take effect until it's processed in the ios.run() below. if(cmdline) construct::console::spawn(); + // If the user wants to immediately process console commands + // non-interactively from a program argument input, that is enqueued here. if(execute) construct::console::execute({execute});