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

This class represents a single IEC 60870-5 server (slave or controlled station). It is also the main access to the CS 104 server API. More...

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

Public Member Functions

ApplicationLayerParameters GetApplicationLayerParameters ()
 Get active application layer parameters (modify only before starting the server!)
 
APCIParameters GetAPCIParameters ()
 Get active APCI parameters (modify only before starting the server!)
 
 Server ()
 Create a new server using default connection parameters.
 
 Server (TlsSecurityInformation securityInfo)
 Create a new server using default connection parameters and TLS configuration.
 
 Server (APCIParameters apciParameters, ApplicationLayerParameters alParameters)
 Create a new server using the provided connection parameters.
 
 Server (APCIParameters apciParameters, ApplicationLayerParameters alParameters, TlsSecurityInformation securityInfo)
 Create a new server using the provided connection parameters.
 
void AddRedundancyGroup (RedundancyGroup redundancyGroup)
 Adds a redundancy group to the server. Each redundancy group has its own event queue.
 
void SetConnectionRequestHandler (ConnectionRequestHandler handler, object parameter)
 Sets a callback handler for connection request. The user can allow (returning true) or deny (returning false) the connection attempt. If no handler is installed every new connection will be accepted.
 
void SetConnectionEventHandler (ConnectionEventHandler handler, object parameter)
 Sets the connection event handler. The connection event handler will be called whenever a new connection was opened, closed, activated, or inactivated.
 
int GetNumberOfQueueEntries (RedundancyGroup redundancyGroup=null)
 
void SetLocalAddress (string localAddress)
 Sets the local IP address to bind the server. Default is "0.0.0.0" for all interfaces.
 
void SetLocalPort (int tcpPort)
 Sets the local TCP port to bind to. Default is 2404, or 19998 when using TLS.
 
void Start ()
 Start the server. Listen to client connections.
 
void Stop ()
 Stop the server. Close all open client connections.
 
bool IsRunning ()
 Check if the server is running (listening to client connections and handling connections) or not.
 
void EnqueueASDU (ASDU asdu)
 Enqueues the ASDU to the transmission queue.
 
- Public Member Functions inherited from lib60870.CS101.Slave
void SetInterrogationHandler (InterrogationHandler handler, object parameter)
 Sets a callback for interrogaton requests.
 
void SetCounterInterrogationHandler (CounterInterrogationHandler handler, object parameter)
 Sets a callback for counter interrogaton requests.
 
void SetReadHandler (ReadHandler handler, object parameter)
 Sets a callback for read requests.
 
void SetClockSynchronizationHandler (ClockSynchronizationHandler handler, object parameter)
 Sets a callback for the clock synchronization request.
 
void SetResetProcessHandler (ResetProcessHandler handler, object parameter)
 
void SetDelayAcquisitionHandler (DelayAcquisitionHandler handler, object parameter)
 
void SetASDUHandler (ASDUHandler handler, object parameter)
 Sets a callback to handle ASDUs (commands, requests) form clients. This callback can be used when no other callback handles the message from the client/master.
 
void SetFileReadyHandler (FileReadyHandler handler, object parameter)
 Sets a callback handler that is called when a file ready message is received from a master.
 
FilesAvailable GetAvailableFiles ()
 Gets the available files that are registered with the file server.
 

Public Attributes

ConnectionRequestHandler connectionRequestHandler = null
 
object connectionRequestHandlerParameter = null
 
- Public Attributes inherited from lib60870.CS101.Slave
InterrogationHandler interrogationHandler = null
 
object InterrogationHandlerParameter = null
 
CounterInterrogationHandler counterInterrogationHandler = null
 
object counterInterrogationHandlerParameter = null
 
ReadHandler readHandler = null
 
object readHandlerParameter = null
 
ClockSynchronizationHandler clockSynchronizationHandler = null
 
object clockSynchronizationHandlerParameter = null
 
ResetProcessHandler resetProcessHandler = null
 
object resetProcessHandlerParameter = null
 
DelayAcquisitionHandler delayAcquisitionHandler = null
 
object delayAcquisitionHandlerParameter = null
 
ASDUHandler asduHandler = null
 
object asduHandlerParameter = null
 

Properties

ServerMode ServerMode [get, set]
 Gets or sets the server mode (behavior regarding redundancy groups)
 
EnqueueMode EnqueueMode [get, set]
 Gets or sets the mode of ASDU queue behaviour. Default mode is EnqueueMode.REMOVE_OLDEST.
 
int MaxQueueSize [get, set]
 Gets or sets the maximum size of the ASDU queue. Setting this property has no effect after calling the Start method.
 
int MaxHighPrioQueueSize [get, set]
 Gets or sets the maximum size of the ASDU high priotity queue. Setting this property has no effect after calling the Start method.
 
int MaxOpenConnections [get, set]
 Gets or sets the maximum number of open TCP connections.
 
int OpenConnections [get]
 Gets the number of connected master/client stations.
 
int ReceiveTimeout [get, set]
 Maximum allowed time for receiving a single message.
 
override int FileTimeout [get, set]
 
- Properties inherited from lib60870.CS101.Slave
bool DebugOutput [get, set]
 
virtual int FileTimeout [get, set]
 Gets or sets the file service timeout.
 

Additional Inherited Members

- Protected Attributes inherited from lib60870.CS101.Slave
bool debugOutput
 
FilesAvailable filesAvailable = new FilesAvailable()
 

Detailed Description

This class represents a single IEC 60870-5 server (slave or controlled station). It is also the main access to the CS 104 server API.

Constructor & Destructor Documentation

◆ Server() [1/3]

lib60870.CS104.Server.Server ( TlsSecurityInformation securityInfo)

Create a new server using default connection parameters and TLS configuration.

Parameters
securityInfoTLS layer configuation, or null when not using TLS

◆ Server() [2/3]

lib60870.CS104.Server.Server ( APCIParameters apciParameters,
ApplicationLayerParameters alParameters )

Create a new server using the provided connection parameters.

Parameters
apciParametersAPCI parameters
alParametersapplication layer parameters

◆ Server() [3/3]

lib60870.CS104.Server.Server ( APCIParameters apciParameters,
ApplicationLayerParameters alParameters,
TlsSecurityInformation securityInfo )

Create a new server using the provided connection parameters.

Parameters
apciParametersAPCI parameters
alParametersapplication layer parameters

Member Function Documentation

◆ AddRedundancyGroup()

void lib60870.CS104.Server.AddRedundancyGroup ( RedundancyGroup redundancyGroup)

Adds a redundancy group to the server. Each redundancy group has its own event queue.

Parameters
redundancyGroupRedundancy group.

◆ EnqueueASDU()

void lib60870.CS104.Server.EnqueueASDU ( ASDU asdu)

Enqueues the ASDU to the transmission queue.

If an active connection exists the ASDU will be sent to the active client immediately. Otherwhise the ASDU will be added to the transmission queue for later transmission.

Parameters
asduASDU to be sent
Exceptions
lib60870.CS101.ASDUQueueExceptionwhen the ASDU queue is full and mode is EnqueueMode.THROW_EXCEPTION.

◆ GetAPCIParameters()

APCIParameters lib60870.CS104.Server.GetAPCIParameters ( )

Get active APCI parameters (modify only before starting the server!)

Returns
APCI parameters object used by the server

◆ GetApplicationLayerParameters()

ApplicationLayerParameters lib60870.CS104.Server.GetApplicationLayerParameters ( )

Get active application layer parameters (modify only before starting the server!)

Returns
application layer parameters object used by the server

◆ IsRunning()

bool lib60870.CS104.Server.IsRunning ( )

Check if the server is running (listening to client connections and handling connections) or not.

Returns
true when the server is running, false otherwise

◆ SetConnectionEventHandler()

void lib60870.CS104.Server.SetConnectionEventHandler ( ConnectionEventHandler handler,
object parameter )

Sets the connection event handler. The connection event handler will be called whenever a new connection was opened, closed, activated, or inactivated.

Parameters
handlerHandler.
parameterParameter.

◆ SetConnectionRequestHandler()

void lib60870.CS104.Server.SetConnectionRequestHandler ( ConnectionRequestHandler handler,
object parameter )

Sets a callback handler for connection request. The user can allow (returning true) or deny (returning false) the connection attempt. If no handler is installed every new connection will be accepted.

Parameters
handlerHandler.
parameterParameter.

◆ SetLocalAddress()

void lib60870.CS104.Server.SetLocalAddress ( string localAddress)

Sets the local IP address to bind the server. Default is "0.0.0.0" for all interfaces.

Parameters
localAddressLocal IP address or hostname to bind.

◆ SetLocalPort()

void lib60870.CS104.Server.SetLocalPort ( int tcpPort)

Sets the local TCP port to bind to. Default is 2404, or 19998 when using TLS.

Parameters
tcpPortLocal TCP port to bind.

Property Documentation

◆ EnqueueMode

EnqueueMode lib60870.CS104.Server.EnqueueMode
getset

Gets or sets the mode of ASDU queue behaviour. Default mode is EnqueueMode.REMOVE_OLDEST.

the mode of ASDU queue behaviour

◆ MaxHighPrioQueueSize

int lib60870.CS104.Server.MaxHighPrioQueueSize
getset

Gets or sets the maximum size of the ASDU high priotity queue. Setting this property has no effect after calling the Start method.

The size of the max high priotity queue.

◆ MaxOpenConnections

int lib60870.CS104.Server.MaxOpenConnections
getset

Gets or sets the maximum number of open TCP connections.

The maximum number of open TCP connections.

◆ MaxQueueSize

int lib60870.CS104.Server.MaxQueueSize
getset

Gets or sets the maximum size of the ASDU queue. Setting this property has no effect after calling the Start method.

The size of the max queue.

◆ OpenConnections

int lib60870.CS104.Server.OpenConnections
get

Gets the number of connected master/client stations.

The number of open connections.

◆ ServerMode

ServerMode lib60870.CS104.Server.ServerMode
getset

Gets or sets the server mode (behavior regarding redundancy groups)

The server mode.


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