revert fix for regression introduced by fix for #2343, apply fix in nodemanagers which do not invert the inverse property, so bidirectional references were not removed.
Fix cases where a cancellable WaitAsync(ct) on a SemaphoreSlim within a try/finally could end up in a deadlock.
Fix: The WaitAsync must be outside the try/finally block. if the WaitAsync is cancelled, it should not release the semaphore
The goal is to reduce the overall number of builds, stop using end of life platforms in the build pipeline and to support
build of future/deprecated build targets in a custom build step, which is also triggered weekly in the ci builds.
In addition:
- added a doc which describes the release and versioning strategy of this project
- produce the Nuget packges with .NET 8 assemblies.
- produce a Docker build based on a .NET 8 based container.
- add custom test targets to test outdated platforms. Need a manual step to enable for VS or command line.
- bug fixes: the latest move to an alternate crypto library for Bouncy Castle, which is only used for the GDS support and .NET Framework 4.6.2./netstandard2.0, revealed already a few issues which were previously not found.
- only .NET8/.NET6/.NET Framework 4.8 are tested in Pull requests. Remaining builds in weekly scheduled builds.
Since some distributions stop to trust SHA1 signatures by default, replace some internal algorithm checks with SHA256 versions.
The test case to force signature check also reenables ECC tests for .NET 4.8 which had been previously disabled.
- Implement the reconnect and republish with async service calls.
bug fixes:
- subscription Ids should start from a random number
- the keep alive interval calculation is too short, adding +1 for the timeout
- on BadSessionIdInvalid recreate session immediately
- on a restarted server with new certificate, also reload endpoints when BadCertificateInvalid is returned
Currently, due to some internal cloning of sessions, subscriptions and monitored items it is not possible to use subclassed variants which are properly recreated after a session reconnect.
- Add a `ISessionInstantiator` interface to allow to subclass a `Session` and override virtual function.
- Add a `Subscription.CloneSubscription` and `MonitoredItem.CloneMonitoredItem` virtual method to recreate those with event handlers and client handles.
- A sample implementation with `TestableXXX` classes is provided to test the BadInvalidTimestamp fix by injecting modified timestamps in the session class.
- Remove duplicate `IDisposable` with `Session`. `IClientBase` is disposable already.
- adds `knownTypes` parameter to `Session.Load` and `Session.Save` to support save and restore of custom Subscriptions and Monitored items.
bug fixes:
- IOP: an empty DataTypeDictionary throws an exception when loaded by the complex type system, server are allowed to leave it empty to save memory.
- BadInvalidTimestamp should not be returned when the timestamp in the requestheader is out of sync. #2364
Root cause: Target's IsInverse flag which has incorrect value is used during the removal of source's reference
Fix: Retrieve the source's reference by the targetId first and remove it.
XmlEncoder.WriteArray and XmlDecoder.ReadArray always use the OPC UA XML namespace (http://opcfoundation.org/UA/2008/02/Types.xsd) for the field element that contains the array, regardless of the namespace that the caller may have pushed.
- CloseAsync still used the 'Close' synchronous function
- remove a duplicate definition of IDisposable on ISession
- reduce the log output when the server publish time is out of sync
- bug: if the nested complex type is derived from an abstract type like a Union, the decoder uses the abstract type instead of the actual type to decode
- fix: the loop to determine the supertype of the type to be decoded stops too early and returns an invalid type reference, e.g. for Unions. Instead the loop will now continue until a valid BuiltInType or a Structure or Enumeration type is found.
- improve various log messages, comments etc.
- multiple internal improvements in naming convention handling of async functions
- add FetchSuperTypesAsync
- replace new UTFEncoding() with Encoding.UTF8 singleton
- Add a property to `ApplicationInstance` to `DisableCertificateAutoCreation`
- Add the test case to validate property function
- Refactor some private API to follow coding style with `Async`suffix
- By default behavior is unchanged
Referencing package OPCFoundation.NetStandard.Opc.Ua.Core from a .NET6 targeted project that in it self are using Microsoft.Extensions.Logging.Abstractions 6.0.4 will cause downgrade problems.
Instead for .NET6 targeted applications reference 6.0.x versions of Microsoft.Extensions.Logging.Abstractions.
- Improvements when many sessions need to be opened
- Introduce a OpenAsync version which usesmore async calls for session creation
- add async interfaces to cert validator
- refactor lock of encodeable factory
- add a `EndAsync` property to WriteRequest to allow to await a service call
- add a `EndSendRequestAsync` method to allow implementation of awaitable service calls
* Fixed status code when server is shutdown
* Add latest statuscodes from 1.05.03 to support new BadServerTooBusy error code
* added default throttle delay in case an unknown error is returned on a publish request service call
* Fixed NodeId.CompareTo() null reference exception when InnerNodeId is null
* more test cases and guid compare as described
* special null NodeId check test case
- Currently the `IEncoder`/`IDecoder` interface is not disposable, which makes it difficult to use the interfaces with `using`. Only the implementations are derived from `IDisposable`
- Change: Moved the `IDisposable` interface from implementations to the IEncoder/IDecoder
- To fully support the use of the interfaces across the codebase new methods are added: `Close` and `CloseAndReturnAsText`
- Breaking change: In the `XmlEncoder` the `Close` method which returns an encoded string is renamed to `CloseAndReturnAsText`
- Refactor codebase to use `using` with IEncoder/IDecoder across the board. Use interfaces where possible.
- To support streaming better with `ArraySegmentStream`, derive this class from `MemoryStream` and implement `ToArray`
- A few use cases were still missing from the ISessionFactory interface to make the static `Session.Create` functions completely obsolete.
- Follow naming conventions (Async) and add CancellationToken where missing.
- Add the system diagnostics library for unsupported target platforms
- Integrate in clientfixture by adding IDisposable to support to enable/disable the activity tracing
- fix Traceable session dispose issue, do not null the disposed session
- Support Client.Session API to save and restore session configuration information as xml or in a serializable data structure.
- Support to reactivate a session using a new secure channel.
- API tests
- `DiagnosticInfo` contains the `InnerDiagnosticInfo` which can be nested. Limit the recursion to `MaxInnerDepth` in multiple places to prevent stack overflow / endless loops.
- The default value for MaxInnerDepth should not be more than 5.
- A NodeId string can be assigned to a NodeId and is automatically parsed. However, if the string contains a "nsu=" it is considered a string type NodeId instead of decoding the namespaceUri. To avoid this error in the code an `ArgumentException` is thrown to uncover these coding errors. Such a variable needs to be an ExpandedNodeId to be decoded correctly.
- Breaking change: To reduce coding errors the user group decided to throw also on a constructor call which does not contain a nodeid type prefix and namespace index. e.g. `new NodeId("Testnode")`. If somebody wants a string NodeId in Namespace 0 then call the constructor `new NodeId("TestNode", 0)`
- Implement IEquatable<NodeId>/IEquatable<ExpandedNodeId>
- Tests to ensure .Distinct treats all Null NodeIds as identical.
- Unit tests for constructor behavior.
- Add only the zipped NodeSet2.xml as embedded resource
- Reduces assembly size by at least 2MB
- Breaking Change: Embedded resource Opc.Ua.NodeSet2.xml is now Opc.Ua.NodeSet2.xml.zip
* The suggestion from .net team is to use shared pool if you have < 1mb buffers you need.
* We now share buffers across connections which is far more efficient when many channels are created and closed.
- With the `sequentialPublishing` flag enabled, no data is received after transfer. Fix: add a resync flag to update the last sequence counter after transfer.
- Instead of the semaphore slim use a dedicated Task per subscription. The task is using `AsyncAutoResetEvent` to be task friendly, becasue every subscription gets a worker task.
- Add more tests for the use case republish with delayed ack.
- Add a test and a missing method to support reconnect of a session on a different secure channel without reconnect handler.
- in order to abstract the implementation of a IEncoder/IDecoder for Json with some extra methods and properties, derive JsonEncoder/Jsondecoder from a IJsonDecoder/IJsonEncoder interface
- breaking change: the use of reversible/non-reversible subencoding is handled by a new method:
`void UsingReversibleEncoding<T>(Action<string, T> action, string fieldName, T value, bool useReversibleEncoding)`
Complex Type support assumes that every OPC type is represented by exactly one .Net type, which in turn knows encoding ids, XML names etc.
These changes enable use of a single type that implements encoding/decoding based on OPC type information at runtime.
- Issue fix: Currently when diagnostics is enabled in client calls, the string table in the response header is not updated when a service call is split into multiple service calls. In this case the stringtables from all calls must be appended and the index in the diagnosticinfo must be updated to match the updated string list.
- To reduce the number of 'null' DiagnosticInfo allocations, the decoders now try to return null instead of a default DiagnosticInfo. A new property ÌsNullDiagnosticInfo' can be used to check for unused DiagnosticInfo entries.
- The tests were slightly improved to use test set data from the generated TestData namespace, which contains also a historical node.
- All `ServerFixtureUtils.ValidateXXX` checks were updated to include the check for diagnosticInfos and the string tables to catch issues.
- SessionClientBatched doesn't handle the case when diagnosticinfos are requested and the batched calls returns mixed empty or non empty diagnostic infos, then the returned infos did not match the number of requested items.
- write of arrays of analogItemState are not properly checked
- BuildInfo properties were empty because BuildInfoVariableValue is never initialized
- DataType and ReferenceType may return null attributes instead of BadAttributeIdInvalid.
- Add BuildInfo test and fix the NodeCacheTest
In some use cases (e.g. Kubernetes secrets) it would be beneficial to store the certificates, private keys, crl etc. in a flat directory instead of having a root which contains a hierarchy with certs/crl/private etc.
- Modify the `DirectoryCertificateStore` to allow it to use a flat structure by adding a special constructor.
- Add the configuration builder functions to allow to specify custom certificate stores for app/user/https.
- Add a test sample which shows how to use the 'flat store' with a custom cert store wrapper.
- By default, behavior of `DirectoryCertificateStore` is unchanged. Needs an external wrapper to expose the flat mode.
- if `DisableMonitoredItemCache` is set, the sequencenumber and publish time are unavailable. Add helpers to NotificationData to get the information in the fast data and event callbacks.
- new fast callback for keep alive messages
Currently the https protocol doesn't support a spec compliant endpoint with a `opc.https` prefix., as client and server.
Fix:
- Add the client and server support for the `opc.https` prefix.
- Continue support for `https` prefix for non compliant implementations.
- Any CancellationTokenSource should be disposed after being used.
- Follow coding guidelines
- Use macOS cert callback