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 const float timeout_seconds = arguments.get_option<
float>
59 const int log_level = arguments.get_option<
int>(
"log_level",
"level", 100);
61 arguments.add_parameter(
"<file.joedb>+");
63 if (arguments.get_remaining_count() == 0)
65 arguments.print_help(std::cerr);
69 std::list<std::unique_ptr<Server_Data>> servers;
71 Stream_Logger logger(std::cerr);
73 while (arguments.get_remaining_count())
75 const std::string file_name(arguments.get_next());
76 std::cerr <<
"Creating server for: " << file_name <<
'\n';
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.