diff options
| author | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-13 18:00:17 +1100 |
|---|---|---|
| committer | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-13 18:00:17 +1100 |
| commit | 98cef5e9a772602d42acfcf233838c760424db9a (patch) | |
| tree | 5277fa1d7cc0a69a0f166fcbf10fd320f345f049 /comp3331/server/src/client/main.cc | |
initial commit
Diffstat (limited to 'comp3331/server/src/client/main.cc')
| -rw-r--r-- | comp3331/server/src/client/main.cc | 28 |
1 files changed, 28 insertions, 0 deletions
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<int>\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; +} |
