Description
Data class to hold all connection related options.
Properties
stringHost: Host name or IP address of the broker.intPort: Port number where the broker is listening on.boolUseTLS: Whether to use a secure protocol (TLS).SupportedTransportsTransport: Selected transport to connect with. It can beSupportedTransports.TCPorSupportedTransports.WebSocket. Its default value isSupportedTransports.TCP.stringPath: Optional path for websocket, its default is"/mqtt".SupportedProtocolVersionsProtocolVersion: The protocol version that the plugin has to use to connect with to the server. It can beSupportedProtocolVersions.MQTT_3_1_1orSupportedProtocolVersions.MQTT_5_0. Its default value isSupportedProtocolVersions.MQTT_5_0.
Examples
The following example creates a ConnectionOptions to connect to localhost on port 1883 using the TCP transport and MQTT protocol version v3.1.1.
ConnectionOptions options = new ConnectionOptions {
Host = "localhost",
Port = 1883,
ProtocolVersion = SupportedProtocolVersions.MQTT_3_1_1
};
var client = new MQTTClient(options);