Hi,
we have a problem with disposing an EasyUAClient.
The problem occurs in a case when a connection is lost to a remote server to which some items were subscribed. The connection is lost either because the remote site lost internet connection or when a VPN that we are using closes the connection. After the site is back online the the library cannot reestablish connection. That is another problem but we can just restart the service that is using the EasyUAClient and when we try that ther is a problem with disposing the EasyUAClinet instance.
The code we are using when stopping the service is as follows:
_client.UnsubscribeAllMonitoredItems();
_client.Dispose();
where the _client is the EasyUAClinet instance. The code hangs on dispose and we have to manualy kill the task.
When the connection to site is lost we get a following error from EasyUAClient.LogEntry:
ERROR 2016-07-07T10:18:26.667+01:00 OPC OPC Event Source: OPCLabs-UAEngine Category: 0 Id:1 Message: INTERNAL ERROR. The OPC-UA engine might be in an unstable state.
An exception of type 'System.NullReferenceException' from source 'OpcLabs.EasyOpcUAInternal' has occurred in OPC-UA SDK callback 'Subscription.PublishStatusChanged'. The exception descend follows.
(1) {System.NullReferenceException} OpcLabs.EasyOpcUAInternal(ConsumeSdkPublishStatusChangedQueue) -> Object reference not set to an instance of an object.
Is there another way to dispose of the EasyUAClient ?
Regards,
Michal Waclawski
This email address is being protected from spambots. You need JavaScript enabled to view it.