Browse Source

changed ServerAddress to the more appropriate ServerEndpoint

thomas 4 years ago
parent
commit
55d5f2d70c
2 changed files with 5 additions and 5 deletions
  1. 1 1
      src/ua-stress-test/config.cfg
  2. 4 4
      src/ua-stress-test/main.cpp

+ 1 - 1
src/ua-stress-test/config.cfg

@@ -4,5 +4,5 @@ EnableConsoleOutput:true;
 
 OpcUa:
 {
-    ServerAddress:"opc.tcp://192.168.40.15:48030";
+    ServerEndpoint:"opc.tcp://192.168.1.20:4840";
 };

+ 4 - 4
src/ua-stress-test/main.cpp

@@ -22,7 +22,7 @@
 int cfg_NumberOfConnections = 10;
 int cfg_OpcUaReadsPerConnectionPerS = 1;
 bool cfg_EnableConsoleOutput;
-char *cfg_OpcUa_ServerAddress;
+char *cfg_OpcUa_ServerEndpoint;
 
 using namespace std;
 
@@ -37,10 +37,10 @@ void workerThread()
     // open OPC UA connection to server
     UA_Client *client = UA_Client_new();
     UA_ClientConfig_setDefault(UA_Client_getConfig(client));
-    UA_StatusCode retval = UA_Client_connect(client, cfg_OpcUa_ServerAddress); // Should be something like "opc.tcp://localhost:4840"
+    UA_StatusCode retval = UA_Client_connect(client, cfg_OpcUa_ServerEndpoint); // Should be something like "opc.tcp://localhost:4840"
     if(retval != UA_STATUSCODE_GOOD) {
         UA_Client_delete(client);
-        cerr << "Could not open OPC UA connection to " << cfg_OpcUa_ServerAddress << endl;
+        cerr << "Could not open OPC UA connection to " << cfg_OpcUa_ServerEndpoint << endl;
         return;
     }
     
@@ -102,7 +102,7 @@ int main(int argc, char **argv) {
     configOk &= getIntFromConfig(&cfg, "NumberOfConnections", &cfg_NumberOfConnections);
     configOk &= getIntFromConfig(&cfg, "OpcUaReadsPerConnectionPerS", &cfg_OpcUaReadsPerConnectionPerS);
     configOk &= getBoolFromConfig(&cfg, "EnableConsoleOutput", &cfg_EnableConsoleOutput);
-    configOk &= getStringFromConfig(&cfg, "OpcUa.ServerAddress", &cfg_OpcUa_ServerAddress);
+    configOk &= getStringFromConfig(&cfg, "OpcUa.ServerEndpoint", &cfg_OpcUa_ServerEndpoint);
     if(!configOk){
         config_destroy(&cfg);
         return EXIT_FAILURE;