diff --git a/README.md b/README.md index e191dbd4..4f7029a3 100644 --- a/README.md +++ b/README.md @@ -361,6 +361,10 @@ Options: --msec, --maxsessioncount=VALUE maximum number of parallel sessions. Default: 100 + --mset, --maxsessiontimeout=VALUE + maximum time that a session can remain open + without communication in milliseconds. + Default: 3600000 --msuc, --maxsubscriptioncount=VALUE maximum number of subscriptions. Default: 100 diff --git a/src/Configuration/CliOptions.cs b/src/Configuration/CliOptions.cs index d81c2c6d..cb31af8b 100644 --- a/src/Configuration/CliOptions.cs +++ b/src/Configuration/CliOptions.cs @@ -97,7 +97,8 @@ public static (PlcSimulation PlcSimulationInstance, List ExtraArgs) Init { "to|trustowncert", $"the own certificate is put into the trusted certificate store automatically.\nDefault: {config.OpcUa.TrustMyself}", (s) => config.OpcUa.TrustMyself = s != null }, - { "msec|maxsessioncount=", $"maximum number of parallel sessions.\nDefault: {config.OpcUa.MaxSessionCount}", (int i) => config.OpcUa.MaxSessionCount = i }, + { "msec|maxsessioncount=", $"maximum number of parallel sessions.\nDefault: {config.OpcUa.MaxSessionCount}", (int i) => config.OpcUa.MaxSessionCount = i }, + { "mset|maxsessiontimeout=", $"maximum time that a session can remain open without communication in milliseconds.\nDefault: {config.OpcUa.MaxSessionTimeout}", (int i) => config.OpcUa.MaxSessionTimeout = i }, { "msuc|maxsubscriptioncount=", $"maximum number of subscriptions.\nDefault: {config.OpcUa.MaxSubscriptionCount}", (int i) => config.OpcUa.MaxSubscriptionCount = i }, { "mqrc|maxqueuedrequestcount=", $"maximum number of requests that will be queued waiting for a thread.\nDefault: {config.OpcUa.MaxQueuedRequestCount}", (int i) => config.OpcUa.MaxQueuedRequestCount = i }, diff --git a/src/Configuration/OpcApplicationConfiguration.cs b/src/Configuration/OpcApplicationConfiguration.cs index 82f7fa8e..c4b4e051 100644 --- a/src/Configuration/OpcApplicationConfiguration.cs +++ b/src/Configuration/OpcApplicationConfiguration.cs @@ -30,6 +30,8 @@ public string Hostname public int MaxSessionCount { get; set; } = 100; + public int MaxSessionTimeout { get; set; } = 3_600_000; // 1 h. + public int MaxSubscriptionCount { get; set; } = 100; public int MaxQueuedRequestCount { get; set; } = 2_000; diff --git a/src/Configuration/OpcUaAppConfigFactory.cs b/src/Configuration/OpcUaAppConfigFactory.cs index eed50ba1..959575c1 100644 --- a/src/Configuration/OpcUaAppConfigFactory.cs +++ b/src/Configuration/OpcUaAppConfigFactory.cs @@ -109,6 +109,7 @@ public async Task ConfigureAsync() .SetAuditingEnabled(true) // Set the server capabilities. .SetMaxSessionCount(_config.OpcUa.MaxSessionCount) + .SetMaxSessionTimeout(_config.OpcUa.MaxSessionTimeout) .SetMaxSubscriptionCount(_config.OpcUa.MaxSubscriptionCount) .SetMaxQueuedRequestCount(_config.OpcUa.MaxQueuedRequestCount) .SetOperationLimits(operationLimits) diff --git a/src/opc-plc.csproj b/src/opc-plc.csproj index 43e0a297..f2765927 100644 --- a/src/opc-plc.csproj +++ b/src/opc-plc.csproj @@ -33,17 +33,17 @@ - + - + - - + + diff --git a/tests/opc-plc-tests.csproj b/tests/opc-plc-tests.csproj index 6f4de3e4..8321ab15 100644 --- a/tests/opc-plc-tests.csproj +++ b/tests/opc-plc-tests.csproj @@ -13,15 +13,15 @@ - + - - - + + + diff --git a/version.json b/version.json index def793d3..2a3b3fbc 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "2.12.11", + "version": "2.12.12", "versionHeightOffset": -1, "publicReleaseRefSpec": [ "^refs/heads/main$",