rodbus (.NET API) 1.3.1
|
Handle to the running server. The server runs on a background task until this class is destroyed. More...
Public Member Functions | |
void | Shutdown () |
Shutdown and release all resources of a running server More... | |
void | UpdateDatabase (byte unitId, Action< Database > transaction) |
Update the database associated with a particular unit id. If the unit id exists, lock the database and call user code to perform the transaction More... | |
void | SetDecodeLevel (DecodeLevel level) |
Set the decoding level for the server More... | |
Static Public Member Functions | |
static Server | CreateTcp (Runtime runtime, string address, ushort port, AddressFilter filter, ushort maxSessions, DeviceMap endpoints, DecodeLevel decodeLevel) |
Launch a TCP server. More... | |
static Server | CreateRtu (Runtime runtime, string path, SerialPortSettings serialParams, RetryStrategy retry, DeviceMap endpoints, DecodeLevel decodeLevel) |
Launch a RTU server. More... | |
static Server | CreateTlsWithAuthz (Runtime runtime, string address, ushort port, AddressFilter filter, ushort maxSessions, DeviceMap endpoints, TlsServerConfig tlsConfig, IAuthorizationHandler authorizationHandler, DecodeLevel decodeLevel) |
Create a Modbus Security (TLS) server. More... | |
static Server | CreateTls (Runtime runtime, string address, ushort port, AddressFilter filter, ushort maxSessions, DeviceMap endpoints, TlsServerConfig tlsConfig, DecodeLevel decodeLevel) |
Create a TLS server that does NOT require the client role extension More... | |
Handle to the running server. The server runs on a background task until this class is destroyed.
|
inlinestatic |
Launch a RTU server.
runtime | runtime on which to spawn the server |
path | Path to the serial device. Generally /dev/tty0 on Linux and COM1 on Windows. |
serialParams | Serial port settings |
retry | Parameters that control How long to wait before re-opening the serial port |
endpoints | map of endpoints which is emptied upon passing to this function |
decodeLevel | Decode levels for this server |
ParamException |
|
inlinestatic |
Launch a TCP server.
Recommended port for Modbus is 502.
When the maximum number of concurrent sessions is reached, the oldest session is closed.
runtime | runtime on which to spawn the server |
address | Local IP (v4/v6) address. Accepts '0.0.0.0' (all adapters), '127.0.0.1' (localhost), or the address of a particular network adapter |
port | Port on which to listen |
filter | Filter used to limit which IP address(es) can connect |
maxSessions | Maximum number of concurrent sessions |
endpoints | Map of endpoints which is emptied upon passing to this function |
decodeLevel | Decode levels for this server |
ParamException |
|
inlinestatic |
Create a TLS server that does NOT require the client role extension
This functionality is not standardized by Modbus.org, but nevertheless is commonly implemented
When the maximum number of concurrent sessions is reached, the oldest session is closed.
runtime | runtime on which to spawn the server |
address | Local IP (v4/v6) address. Accepts '0.0.0.0' (all adapters), '127.0.0.1' (localhost), or the address of a particular network adapter |
port | Port on which to listen |
filter | Filter used to limit which IP address(es) can connect |
maxSessions | Maximum number of concurrent sessions |
endpoints | map of endpoints which is emptied upon passing to this function |
tlsConfig | TLS server configuration |
decodeLevel | Decode levels for this server |
ParamException |
|
inlinestatic |
Create a Modbus Security (TLS) server.
This server requires that the client certificate contains the role extension and authorizes each request against the supplied handler.
Recommended port for Modbus Security is 802.
When the maximum number of concurrent sessions is reached, the oldest session is closed.
runtime | runtime on which to spawn the server |
address | Local IP (v4/v6) address. Accepts '0.0.0.0' (all adapters), '127.0.0.1' (localhost), or the address of a particular network adapter |
port | Port on which to listen |
filter | Filter used to limit which IP address(es) can connect |
maxSessions | Maximum number of concurrent sessions |
endpoints | map of endpoints which is emptied upon passing to this function |
tlsConfig | TLS server configuration |
authorizationHandler | Authorization handler |
decodeLevel | Decode levels for this server |
ParamException |
|
inline |
Set the decoding level for the server
level | Decoding level |
ParamException |
|
inline |
Shutdown and release all resources of a running server
|
inline |
Update the database associated with a particular unit id. If the unit id exists, lock the database and call user code to perform the transaction
unitId | Unit id of the database to update |
transaction | Callback invoked when a lock has been acquired |
ParamException |