mirror of
https://github.com/modelec/TCPSocketClient.git
synced 2026-01-18 16:37:35 +01:00
add port as argument
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user