26 asio::io_context &io_context,
27 const std::string &file_name,
28 const std::string &endpoint_path,
29 std::chrono::milliseconds timeout
32 client(file, connection),
46 static int multi_server(Arguments &arguments)
49 const float timeout_seconds = arguments.get_option<
float>
56 arguments.add_parameter(
"<file.joedb>+");
58 if (arguments.get_remaining_count() == 0)
60 arguments.print_help(std::cerr);
64 IO_Context_Wrapper io_context_wrapper;
66 std::list<std::unique_ptr<Server_Data>> servers;
68 while (arguments.get_remaining_count())
70 const std::string file_name(arguments.get_next());
71 std::cerr <<
"Creating server for: " << file_name <<
'\n';
76 io_context_wrapper.io_context,
79 std::chrono::milliseconds(
int(timeout_seconds * 1000))
84 io_context_wrapper.run();
91int main(
int argc,
char **argv)
Server_Data(asio::io_context &io_context, 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.