add port as argument

This commit is contained in:
ackimixs
2024-03-28 13:44:52 +01:00
parent a4a5e56daf
commit 9a149f6509

View File

@@ -1,7 +1,13 @@
#include <TCPSocket/TCPClient.hpp>
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();