lib60870.NET 2.3.0
IEC 60870-5-101/104 Protocol Source Code Library for C#/.NET
|
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...
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. | |
![]() | |
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 |
![]() | |
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] |
![]() | |
bool | DebugOutput [get, set] |
virtual int | FileTimeout [get, set] |
Gets or sets the file service timeout. | |
Additional Inherited Members | |
![]() | |
bool | debugOutput |
FilesAvailable | filesAvailable = new FilesAvailable() |
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.
lib60870.CS104.Server.Server | ( | TlsSecurityInformation | securityInfo | ) |
Create a new server using default connection parameters and TLS configuration.
securityInfo | TLS layer configuation, or null when not using TLS |
lib60870.CS104.Server.Server | ( | APCIParameters | apciParameters, |
ApplicationLayerParameters | alParameters ) |
Create a new server using the provided connection parameters.
apciParameters | APCI parameters |
alParameters | application layer parameters |
lib60870.CS104.Server.Server | ( | APCIParameters | apciParameters, |
ApplicationLayerParameters | alParameters, | ||
TlsSecurityInformation | securityInfo ) |
Create a new server using the provided connection parameters.
apciParameters | APCI parameters |
alParameters | application layer parameters |
void lib60870.CS104.Server.AddRedundancyGroup | ( | RedundancyGroup | redundancyGroup | ) |
Adds a redundancy group to the server. Each redundancy group has its own event queue.
redundancyGroup | Redundancy group. |
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.
asdu | ASDU to be sent |
lib60870.CS101.ASDUQueueException | when the ASDU queue is full and mode is EnqueueMode.THROW_EXCEPTION. |
APCIParameters lib60870.CS104.Server.GetAPCIParameters | ( | ) |
Get active APCI parameters (modify only before starting the server!)
ApplicationLayerParameters lib60870.CS104.Server.GetApplicationLayerParameters | ( | ) |
Get active application layer parameters (modify only before starting the server!)
bool lib60870.CS104.Server.IsRunning | ( | ) |
Check if the server is running (listening to client connections and handling connections) or not.
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.
handler | Handler. |
parameter | Parameter. |
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.
handler | Handler. |
parameter | Parameter. |
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.
localAddress | Local IP address or hostname to bind. |
void lib60870.CS104.Server.SetLocalPort | ( | int | tcpPort | ) |
Sets the local TCP port to bind to. Default is 2404, or 19998 when using TLS.
tcpPort | Local TCP port to bind. |
|
getset |
Gets or sets the mode of ASDU queue behaviour. Default mode is EnqueueMode.REMOVE_OLDEST.
the mode of ASDU queue behaviour
|
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.
|
getset |
Gets or sets the maximum number of open TCP connections.
The maximum number of open TCP connections.
|
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.
|
get |
Gets the number of connected master/client stations.
The number of open connections.
|
getset |
Gets or sets the server mode (behavior regarding redundancy groups)
The server mode.