lib60870.NET 2.3.0
IEC 60870-5-101/104 Protocol Source Code Library for C#/.NET
Loading...
Searching...
No Matches
lib60870.CS104.ClientConnection Class Reference

Represents a client (master) connection. More...

Inheritance diagram for lib60870.CS104.ClientConnection:
Collaboration diagram for lib60870.CS104.ClientConnection:

Public Member Functions

ApplicationLayerParameters GetApplicationLayerParameters ()
 Gets the connection parameters.
 
bool MasterConnection_hasUnconfirmedMessages ()
 Checks if there are any unconfirmed messages in the low-priority or high-priority queues.
 
void SendASDU (ASDU asdu)
 Send a response ASDU over this connection.
 
void SendACT_CON (ASDU asdu, bool negative)
 Sends an Activation Confirmation (ACT_CON) ASDU with the specified negative flag.
 
void SendACT_TERM (ASDU asdu)
 Sends an Activation Termination (ACT_TERM) ASDU with a negative flag set to false.
 
bool CertificateValidationCallback (object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors sslPolicyErrors)
 Callback method to handle certificate validation in SSL/TLS communication. It checks various conditions such as certificate chain validation, specific certificate validation, and SSL policy errors to determine whether the certificate is valid for the current connection.
 
void Close ()
 
void ASDUReadyToSend ()
 

Properties

IPEndPoint RemoteEndpoint [get]
 Gets the remote endpoint (client IP address and TCP port)
 
bool IsActive [get, set]
 Gets or sets a value indicating whether this connection is active. The active connection is the only connection that is answering application layer requests and sends cyclic, and spontaneous messages.
 
MasterConnectionState State [get, set]
 

Detailed Description

Represents a client (master) connection.

Member Function Documentation

◆ CertificateValidationCallback()

bool lib60870.CS104.ClientConnection.CertificateValidationCallback ( object sender,
X509Certificate cert,
X509Chain chain,
SslPolicyErrors sslPolicyErrors )

Callback method to handle certificate validation in SSL/TLS communication. It checks various conditions such as certificate chain validation, specific certificate validation, and SSL policy errors to determine whether the certificate is valid for the current connection.

Parameters
senderThe source of the event. This is typically the SSL/TLS connection.
certThe certificate being validated.
chainThe certificate chain associated with the certificate.
sslPolicyErrorsThe SSL policy errors that occurred during certificate validation.
Returns
Returns true if the certificate is considered valid based on the specified criteria; otherwise, returns false.

◆ GetApplicationLayerParameters()

ApplicationLayerParameters lib60870.CS104.ClientConnection.GetApplicationLayerParameters ( )

Gets the connection parameters.

Returns
The connection parameters used by the server.

Implements lib60870.CS101.IMasterConnection.

◆ MasterConnection_hasUnconfirmedMessages()

bool lib60870.CS104.ClientConnection.MasterConnection_hasUnconfirmedMessages ( )

Checks if there are any unconfirmed messages in the low-priority or high-priority queues.

Returns
true if there are unconfirmed messages in either the low-priority or high-priority queues; false if no unconfirmed messages are found.

◆ SendACT_CON()

void lib60870.CS104.ClientConnection.SendACT_CON ( ASDU asdu,
bool negative )

Sends an Activation Confirmation (ACT_CON) ASDU with the specified negative flag.

Parameters
asduThe ASDU to be sent as an Activation Confirmation (ACT_CON).
negativeA boolean flag indicating whether the Activation Confirmation is negative.

Implements lib60870.CS101.IMasterConnection.

◆ SendACT_TERM()

void lib60870.CS104.ClientConnection.SendACT_TERM ( ASDU asdu)

Sends an Activation Termination (ACT_TERM) ASDU with a negative flag set to false.

Parameters
asduThe ASDU to be sent as an Activation Termination (ACT_TERM).

Implements lib60870.CS101.IMasterConnection.

◆ SendASDU()

void lib60870.CS104.ClientConnection.SendASDU ( ASDU asdu)

Send a response ASDU over this connection.

Exceptions
ConnectionExceptionThrows an exception if the connection is no longer active (e.g. because it has been closed by the other side).
Parameters
asduThe ASDU to send

Implements lib60870.CS101.IMasterConnection.

Property Documentation

◆ IsActive

bool lib60870.CS104.ClientConnection.IsActive
getset

Gets or sets a value indicating whether this connection is active. The active connection is the only connection that is answering application layer requests and sends cyclic, and spontaneous messages.

true if this instance is active; otherwise, false.

◆ RemoteEndpoint

IPEndPoint lib60870.CS104.ClientConnection.RemoteEndpoint
get

Gets the remote endpoint (client IP address and TCP port)

The remote IP endpoint


The documentation for this class was generated from the following file: