Connectivity Software User's Guide and Reference
DataSourceConnectionFailure Method (EasySparkplugEdgeNodeCore)



OpcLabs.EasySparkplug Assembly > OpcLabs.EasySparkplug Namespace > EasySparkplugEdgeNodeCore Class : DataSourceConnectionFailure Method
The exception object that describes the cause of the failure.

The value of this parameter cannot be null (Nothing in Visual Basic).

The interval, in milliseconds, in which reconnection wil lbe attempted.
Indicates that the data source connection for the edge node or device has failed.
Syntax
'Declaration
 
Public Sub DataSourceConnectionFailure( _
   ByVal exception As Exception, _
   ByVal reconnectIntervalMilliseconds As Integer _
) 
'Usage
 
Dim instance As EasySparkplugEdgeNodeCore
Dim exception As Exception
Dim reconnectIntervalMilliseconds As Integer
 
instance.DataSourceConnectionFailure(exception, reconnectIntervalMilliseconds)
public void DataSourceConnectionFailure( 
   Exception exception,
   int reconnectIntervalMilliseconds
)
public:
void DataSourceConnectionFailure( 
   Exception^ exception,
   int reconnectIntervalMilliseconds
) 

Parameters

exception
The exception object that describes the cause of the failure.

The value of this parameter cannot be null (Nothing in Visual Basic).

reconnectIntervalMilliseconds
The interval, in milliseconds, in which reconnection wil lbe attempted.
Exceptions
ExceptionDescription

A null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

The value of an argument is outside the allowable range of values as defined by the invoked method.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

An operation was performed on a disposed object.
Remarks

You can call this method as consequence of the ISparkplugProducerEvents.ConnectDataSource event, or at any time when the data source was already connected, and a problem has occurred that caused it to disconnect.

After the interval given by reconnectIntervalMilliseconds elapses, if the data source connection is still needed, the component will attempt to reconnect the data source by raising the ISparkplugProducerEvents.ConnectDataSource event again.

There are also extension methods that allow to perform this operation with an error message (a string) instead of the exception object, or with just the exception object (with no scheduled reconnection).

This method has no effect if the producer is not started (the usual System.InvalidOperationException is *not* thrown in this case, because the caller operates asynchronously, and it cannot always control or follow the state of the producer).

 

Sparkplug is a trademark of Eclipse Foundation, Inc. "MQTT" is a trademark of the OASIS Open standards consortium. Other related terms are trademarks of their respective owners. Any use of these terms on this site is for descriptive purposes only and does not imply any sponsorship, endorsement or affiliation.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also