27 const std::string &file_name,
28 const std::string &endpoint_path,
29 std::chrono::milliseconds timeout
49 static int multi_server(Arguments &arguments)
52 Parsed_Logger logger(arguments);
54 const float timeout_seconds = arguments.get_option<
float>
61 const int log_level = arguments.get_option<
int>(
"log_level",
"level", 100);
63 arguments.add_parameter(
"<file.joedb>+");
65 if (arguments.get_remaining_count() == 0)
67 arguments.print_help(std::cerr);
71 std::list<std::unique_ptr<Server_Data>> servers;
73 while (arguments.get_remaining_count())
75 const std::string file_name(arguments.get_next());
76 logger.get().log(
"creating server for: " + file_name);
85 std::chrono::milliseconds(std::lround(timeout_seconds * 1000))
90 for (
auto &server: servers)
98int main(
int argc,
char **argv)
Server_Data(Logger &logger, int log_level, const std::string &file_name, const std::string &endpoint_path, std::chrono::milliseconds timeout)
@ write_existing_or_create_new
either write_existing or create_new depending on whether the file exists. Racy in Posix,...
int main_wrapper(int(*main)(Arguments &), int argc, char **argv)
Process command-line arguments and catch exceptions from main.