From 9a149f6509ff8af303fedb235999860fad5be145 Mon Sep 17 00:00:00 2001 From: ackimixs Date: Thu, 28 Mar 2024 13:44:52 +0100 Subject: [PATCH] add port as argument --- example/client.test.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/example/client.test.cpp b/example/client.test.cpp index bd4a05f..97846ab 100644 --- a/example/client.test.cpp +++ b/example/client.test.cpp @@ -1,7 +1,13 @@ #include -int main() { - TCPClient client("127.0.0.1", 8082); // Replace "127.0.0.1" with the IP address of your server and 8080 with the port number +int main(int argc, char* argv[]) { + + int port = 8080; + if (argc >= 2) { + port = std::stoi(argv[1]); + } + + TCPClient client("127.0.0.1", port); // Replace "127.0.0.1" with the IP address of your server and 8080 with the port number client.start();