Browse Source

Unbreak the build (#1162)

* Unbreak the build

I suspect that this is a fallout from
commit a8012d3040f903ffd127d06c70c73cbc87379602
Author: Infinity95 <mark.giraud@student.kit.edu>
Date:   Thu Aug 10 19:00:32 2017 +0200

    endpoints in the server config; new/delete functions for the server config

* UA_ConnectionConfig_default already contains a network layer
Frank Meerkötter 7 years ago
parent
commit
3d874ad93b
1 changed files with 2 additions and 6 deletions
  1. 2 6
      examples/server_nodeset.c

+ 2 - 6
examples/server_nodeset.c

@@ -23,10 +23,7 @@ int main(int argc, char** argv) {
     signal(SIGINT, stopHandler); /* catches ctrl-c */
     signal(SIGINT, stopHandler); /* catches ctrl-c */
 
 
     /* initialize the server */
     /* initialize the server */
-    UA_ServerConfig config = UA_ServerConfig_standard;
-    UA_ServerNetworkLayer nl = UA_ServerNetworkLayerTCP(UA_ConnectionConfig_standard, 16664);
-    config.networkLayers = &nl;
-    config.networkLayersSize = 1;
+    UA_ServerConfig *config = UA_ServerConfig_new_default();
     UA_Server *server = UA_Server_new(config);
     UA_Server *server = UA_Server_new(config);
 
 
     /* create nodes from nodeset */
     /* create nodes from nodeset */
@@ -35,7 +32,6 @@ int main(int argc, char** argv) {
                      "nodeset does not match. The call to the generated method has to be "
                      "nodeset does not match. The call to the generated method has to be "
                      "before any other namespace add calls.");
                      "before any other namespace add calls.");
         UA_Server_delete(server);
         UA_Server_delete(server);
-        nl.deleteMembers(&nl);
         return (int)UA_STATUSCODE_BADUNEXPECTEDERROR;
         return (int)UA_STATUSCODE_BADUNEXPECTEDERROR;
     }
     }
 
 
@@ -44,6 +40,6 @@ int main(int argc, char** argv) {
 
 
     /* ctrl-c received -> clean up */
     /* ctrl-c received -> clean up */
     UA_Server_delete(server);
     UA_Server_delete(server);
-    nl.deleteMembers(&nl);
+    UA_ServerConfig_delete(config);
     return (int)retval;
     return (int)retval;
 }
 }