From d2461a025a6688da81a49a9ca914ad7b12585f60 Mon Sep 17 00:00:00 2001 From: "Chun-Sheng, Li" Date: Mon, 25 Jan 2021 17:24:28 +0800 Subject: [PATCH] Adding client port number to be -1 or specific (#2) --- examples/tls_client_example/tls_client_example.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/tls_client_example/tls_client_example.c b/examples/tls_client_example/tls_client_example.c index a2a774d8..b00c7614 100644 --- a/examples/tls_client_example/tls_client_example.c +++ b/examples/tls_client_example/tls_client_example.c @@ -32,9 +32,12 @@ reportCallbackFunction(void* parameter, ClientReport report) int main(int argc, char** argv) { char* hostname; + int port_number = -1; - if (argc > 1) + if (argc > 2) { hostname = argv[1]; + port_number = argv[2]; + } else hostname = "localhost"; @@ -62,7 +65,7 @@ int main(int argc, char** argv) { IedConnection con = IedConnection_createWithTlsSupport(tlsConfig); - IedConnection_connect(con, &error, hostname, -1); + IedConnection_connect(con, &error, hostname, port_number); if (error == IED_ERROR_OK) {