From 98cef5e9a772602d42acfcf233838c760424db9a Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Thu, 13 Feb 2025 18:00:17 +1100 Subject: initial commit --- comp3331/server/src/client/main.cc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 comp3331/server/src/client/main.cc (limited to 'comp3331/server/src/client/main.cc') diff --git a/comp3331/server/src/client/main.cc b/comp3331/server/src/client/main.cc new file mode 100644 index 0000000..a452c3e --- /dev/null +++ b/comp3331/server/src/client/main.cc @@ -0,0 +1,28 @@ +#include "client/main.hh" + +using namespace client; + +int main(const int argc, const char* const argv[]) { + + if (argc != 2) { + std::cerr << "usage: ./client PORT\n"; + return EXIT_SUCCESS; + } + + const char* const address = "localhost"; // not an argument fsr + const char* const port = argv[1]; + + try { + shared::set_exit_handler(); + do_client(address, port); + } catch (const std::exception& e) { + std::cerr << "caught exception from client!\n\twhat(): " << e.what() + << '\n'; + return EXIT_FAILURE; + } catch (...) { + std::cerr << "unhandled exception from client!\n"; + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} -- cgit v1.2.3