lib60870.NET  2.2.0
IEC 60870-5-101/104 Protocol Source Code Library for C#/.NET
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 ()
 
 Server ()
 Create a new server using default connection parameters More...
 
 Server (TlsSecurityInformation securityInfo)
 
 Server (APCIParameters apciParameters, ApplicationLayerParameters alParameters)
 Create a new server using the provided connection parameters. More...
 
 Server (APCIParameters apciParameters, ApplicationLayerParameters alParameters, TlsSecurityInformation securityInfo)
 
void AddRedundancyGroup (RedundancyGroup redundancyGroup)
 Adds a redundancy group to the server. Each redundancy group has its own event queue. More...
 
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. More...
 
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. More...
 
void SetLocalAddress (string localAddress)
 Sets the local IP address to bind the server. Default is "0.0.0.0" for all interfaces More...
 
void SetLocalPort (int tcpPort)
 Sets the local TCP port to bind to. Default is 2404. More...
 
void Start ()
 Start the server. Listen to client connections. More...
 
void Stop ()
 Stop the server. Close all open client connections. More...
 
void EnqueueASDU (ASDU asdu)
 Enqueues the ASDU to the transmission queue. More...
 
- Public Member Functions inherited from lib60870.CS101.Slave
void SetInterrogationHandler (InterrogationHandler handler, object parameter)
 Sets a callback for interrogaton requests. More...
 
void SetCounterInterrogationHandler (CounterInterrogationHandler handler, object parameter)
 Sets a callback for counter interrogaton requests. More...
 
void SetReadHandler (ReadHandler handler, object parameter)
 Sets a callback for read requests. More...
 
void SetClockSynchronizationHandler (ClockSynchronizationHandler handler, object parameter)
 Sets a callback for the clock synchronization request. More...
 
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. More...
 
void SetFileReadyHandler (FileReadyHandler handler, object parameter)
 
FilesAvailable GetAvailableFiles ()
 

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) More...
 
EnqueueMode EnqueueMode [get, set]
 Gets or sets the mode of ASDU queue behaviour. Default mode is EnqueueMode.REMOVE_OLDEST. More...
 
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. More...
 
int MaxOpenConnections [get, set]
 Gets or sets the maximum number of open TCP connections More...
 
int OpenConnections [get]
 Gets the number of connected master/client stations. More...
 
- Properties inherited from lib60870.CS101.Slave
bool DebugOutput [get, set]
 

Additional Inherited Members

- Protected Attributes inherited from lib60870.CS101.Slave
bool debugOutput
 
FileReadyHandler fileReadyHandler = null
 
object fileReadyHandlerParameter = null
 
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/2]

lib60870.CS104.Server.Server ( )

Create a new server using default connection parameters

◆ Server() [2/2]

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

Create a new server using the provided connection parameters.

Parameters
parametersConnection 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.

◆ 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.

Parameters
tcpPortLocal TCP port to bind.

◆ Start()

void lib60870.CS104.Server.Start ( )

Start the server. Listen to client connections.

◆ Stop()

void lib60870.CS104.Server.Stop ( )

Stop the server. Close all open client connections.

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

◆ 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: