![]() |
dnp3 (.NET API) 1.8.0-RC1
|
Builder for configuring connection parameters More...
Public Member Functions | |
| ConnectionInfo () | |
| Create a new ConnectionInfo. You must call set_endpoint() before using it. More... | |
| ParamError | SetEndpoint (string endpoint) |
| Set the endpoint to connect to More... | |
| void | SetTimeout (TimeSpan timeoutMs) |
| Set the connection timeout More... | |
| void | ClearTimeout () |
| Clear any previously configured timeout so the OS default is used More... | |
| ParamError | SetLocalEndpoint (string localEndpoint) |
| Set the local endpoint to bind to More... | |
| void | ClearLocalEndpoint () |
| Clear any previously configured local endpoint so the OS chooses the interface and port More... | |
| ParamError | SetMasterAddress (ushort address) |
| Change the master address for this and all subsequent connections More... | |
Builder for configuring connection parameters
Instances are passed to NextEndpointAction.ConnectTo inside IClientConnectionHandler.Next.
You may construct a new instance for each callback to IClientConnectionHandler.Next or reuse a single instance to reduce allocations.
When reusing, call ConnectionInfo.ClearTimeout or ConnectionInfo.ClearLocalEndpoint before setting new values if you need to revert to the default timeout or adapter selection.
|
inline |
Create a new ConnectionInfo. You must call set_endpoint() before using it.
|
inline |
Clear any previously configured local endpoint so the OS chooses the interface and port
|
inline |
Clear any previously configured timeout so the OS default is used
|
inline |
Set the endpoint to connect to
This method must be called before passing the ConnectionInfo to connect_to()
| endpoint | Endpoint to connect to (hostname or IP:port) |
|
inline |
Set the local endpoint to bind to
Optional: If not called, the OS will select the network adapter based on the routing table for the destination address, and assign an ephemeral port.
This is primarily useful for enforcing network segmentation in multi-homed systems, such as OT gateways that bridge device and enterprise networks. By explicitly binding to a specific adapter, you ensure traffic goes out the correct interface regardless of routing table configuration.
Typically you should specify port 0 to let the OS assign an ephemeral port while forcing a specific network adapter. Using a specific non-zero port is rarely needed for client connections and may cause bind failures if the port is already in use.
| localEndpoint | Local address to bind to |
|
inline |
Change the master address for this and all subsequent connections
Optional: The master address change is persistent and remains active across reconnections until explicitly changed again.
This is useful when an outstation needs to communicate with different masters at different endpoints, such as during failover scenarios or when connecting to a backup master.
If not called, the outstation uses the master address specified in its configuration.
| address | Master link-layer address |
|
inline |
Set the connection timeout
Optional: If not called, the operating system's default timeout will be used
| timeoutMs | Connection timeout |