Skip to content

Reference

OpcClientKeepAlive Members

Provides keep-alive options used by a client to monitor an established connection and recover from unexpected disconnection.

Reference

OpcClientKeepAlive Members ​

Type
OpcClientKeepAlive
Namespace
Opc.UaFx.Client
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Also in
Opc.UaFx.Client

Fields ​

DefaultInterval ​

static

Represents the default interval value that is used by the OpcClientKeepAlive as initial value of the Interval property.

csharp
public static readonly int DefaultInterval
vbnet
Public Shared ReadOnly DefaultInterval As Integer

Field value

Int32

Properties ​

Exception ​

Gets the exception information associated with the Status represented by the current OpcClientKeepAlive.

csharp
public OpcException Exception { get; }
vbnet
Public ReadOnly Property Exception As OpcException

Property value

OpcException

An instance of the OpcException class in case there the IsBad is equals true for the Status offered; otherwise a null reference (Nothing in Visual Basic).

Interval ​

Gets or sets the interval to control the period within the client shall "ping" the server to test (= keep alive) whether the connection is still established and working.

csharp
public int Interval { get; set; }
vbnet
Public Property Interval As Integer

Property value

Int32

The number of milliseconds used to "ping" / test the connection. The default value is DefaultInterval.

Remarks

This interval controls how much time elapses before a communication error is detected. In case there is no abnormality detected the Updated event is raised each time this period elapses.

IsActive ​

Gets a value indicating whether the keep alive mechanism is active and works on a healthy and established connection.

csharp
public bool IsActive { get; }
vbnet
Public ReadOnly Property IsActive As Boolean

Property value

Boolean

The value true if the keep alive is mechanism is active; otherwise the value false.

Message ​

Gets a value which describes the most recent outcome of the keep alive mechanism.

csharp
public string Message { get; }
vbnet
Public ReadOnly Property Message As String

Property value

String

A string which either offeres the textual representation of the Code of the Status (if IsBad of Status is equals false) or the Message (alternatively the Description of the Status) in case there IsBad of Status is equals true.

ServerState ​

Gets a value indicating the most recent known state of the server.

csharp
public OpcServerState ServerState { get; }
vbnet
Public ReadOnly Property ServerState As OpcServerState

Property value

OpcServerState

One of the members defined by the OpcServerState enumeration.

Remarks

The value of this property is determined during the keep alive progress and represents the value published by the server using the value of the node known under the browse path '/Server/ServerStatus/State'.

Status ​

Gets the status information associated with the most recent outcome of the keep alive operation.

csharp
public OpcStatus Status { get; }
vbnet
Public ReadOnly Property Status As OpcStatus

Property value

OpcStatus

An instance of the OpcStatus class which offers additional information about the outcome of the most recent keep alive operation.

Time ​

Gets the time at which the server did respond on the most recent sent keep alive message.

csharp
public DateTime? Time { get; }
vbnet
Public ReadOnly Property Time As Date?

Property value

Nullable<DateTime>

The DateTime at which the server did respond to the most recent keep alive request or a null reference (Nothing in Visual Basic) if there is no connection established to a server.

Methods ​

OnUpdated ​

protected · virtual

Raises the Updated event of the OpcClientKeepAlive.

csharp
protected virtual void OnUpdated(EventArgs e)
vbnet
Protected Overridable Sub OnUpdated(e As EventArgs)

Parameters

NameTypeDescription
eEventArgsThe event data.

ToString ​

2 overloads

OverloadDescription
ToString()overrideReturns a string representing the most recent Time and Message offered by the most recent keep alive operation.
ToString(IFormatProvider)Returns a string representing the most recent Time and Message offered by the most recent keep alive operation formatted using the provider specified.

ToString() ​

override

Returns a string representing the most recent Time and Message offered by the most recent keep alive operation.

csharp
public override string ToString()
vbnet
Public Overrides Function ToString() As String

Returns

String

A string formatted using the InvariantCulture representing the Time and Message of the current OpcClientKeepAlive.

Overrides

ToString()

ToString(IFormatProvider) ​

Returns a string representing the most recent Time and Message offered by the most recent keep alive operation formatted using the provider specified.

csharp
public string ToString(IFormatProvider provider)
vbnet
Public Function ToString(provider As IFormatProvider) As String

Parameters

NameTypeDescription
providerIFormatProviderThe IFormatProvider to use to format the Time.

Returns

String

A string formatted using the provider specified representing the Time and Message of the current OpcClientKeepAlive.

Events ​

Updated ​

Occurs when a keep alive cycle completed and therefore the ServerState, Time, Exception and Status properties were updated accordingly.

csharp
public event EventHandler Updated
vbnet
Public Event Updated As EventHandler

Event type

EventHandler

Remarks

In general this event is raised whenever a keep alive period elapses (see Interval) or an abnormal connection state is detected.