Bläddra i källkod

Merge branch '0.2'

Julius Pfrommer 8 år sedan
förälder
incheckning
ca046757e7
2 ändrade filer med 28 tillägg och 12 borttagningar
  1. 28 7
      plugins/ua_config_standard.c
  2. 0 5
      src/ua_connection.c

+ 28 - 7
plugins/ua_config_standard.c

@@ -5,6 +5,22 @@
 #include "ua_log_stdout.h"
 #include "ua_log_stdout.h"
 #include "ua_network_tcp.h"
 #include "ua_network_tcp.h"
 
 
+/*******************************/
+/* Default Connection Settings */
+/*******************************/
+
+const UA_EXPORT UA_ConnectionConfig UA_ConnectionConfig_standard = {
+    .protocolVersion = 0,
+    .sendBufferSize = 65535, /* 64k per chunk */
+    .recvBufferSize = 65535, /* 64k per chunk */
+    .maxMessageSize = 0, /* 0 -> unlimited */
+    .maxChunkCount = 0 /* 0 -> unlimited */
+};
+
+/***************************/
+/* Default Server Settings */
+/***************************/
+
 #define MANUFACTURER_NAME "open62541"
 #define MANUFACTURER_NAME "open62541"
 #define PRODUCT_NAME "open62541 OPC UA Server"
 #define PRODUCT_NAME "open62541 OPC UA Server"
 #define PRODUCT_URI "http://open62541.org"
 #define PRODUCT_URI "http://open62541.org"
@@ -18,7 +34,7 @@ UA_UsernamePasswordLogin usernamePasswords[2] = {
     { UA_STRING_STATIC("user1"), UA_STRING_STATIC("password") },
     { UA_STRING_STATIC("user1"), UA_STRING_STATIC("password") },
     { UA_STRING_STATIC("user2"), UA_STRING_STATIC("password1") } };
     { UA_STRING_STATIC("user2"), UA_STRING_STATIC("password1") } };
 
 
-const UA_ServerConfig UA_ServerConfig_standard = {
+const UA_EXPORT UA_ServerConfig UA_ServerConfig_standard = {
     .nThreads = 1,
     .nThreads = 1,
     .logger = UA_Log_Stdout,
     .logger = UA_Log_Stdout,
 
 
@@ -75,15 +91,20 @@ const UA_ServerConfig UA_ServerConfig_standard = {
 #endif
 #endif
 };
 };
 
 
+/***************************/
+/* Default Client Settings */
+/***************************/
+
 const UA_EXPORT UA_ClientConfig UA_ClientConfig_standard = {
 const UA_EXPORT UA_ClientConfig UA_ClientConfig_standard = {
-    .timeout = 5000,
-    .secureChannelLifeTime = 600000,
+    .timeout = 5000, /* 5 seconds */
+    .secureChannelLifeTime = 10 * 60 * 1000, /* 10 minutes */
     .logger = UA_Log_Stdout,
     .logger = UA_Log_Stdout,
     .localConnectionConfig = {
     .localConnectionConfig = {
         .protocolVersion = 0,
         .protocolVersion = 0,
-        .sendBufferSize = 65535,
-        .recvBufferSize  = 65535,
-        .maxMessageSize = 65535,
-        .maxChunkCount = 1 },
+        .sendBufferSize = 65535, /* 64k per chunk */
+        .recvBufferSize  = 65535, /* 64k per chunk */
+        .maxMessageSize = 0, /* 0 -> unlimited */
+        .maxChunkCount = 0 /* 0 -> unlimited */
+    },
     .connectionFunc = UA_ClientConnectionTCP
     .connectionFunc = UA_ClientConnectionTCP
 };
 };

+ 0 - 5
src/ua_connection.c

@@ -4,11 +4,6 @@
 #include "ua_types_generated_encoding_binary.h"
 #include "ua_types_generated_encoding_binary.h"
 #include "ua_securechannel.h"
 #include "ua_securechannel.h"
 
 
-// max message size is 64k
-const UA_ConnectionConfig UA_ConnectionConfig_standard =
-    {.protocolVersion = 0, .sendBufferSize = 65535, .recvBufferSize = 65535,
-     .maxMessageSize = 1048576, .maxChunkCount = 16};
-
 void UA_Connection_init(UA_Connection *connection) {
 void UA_Connection_init(UA_Connection *connection) {
     connection->state = UA_CONNECTION_CLOSED;
     connection->state = UA_CONNECTION_CLOSED;
     connection->localConf = UA_ConnectionConfig_standard;
     connection->localConf = UA_ConnectionConfig_standard;