Tcp

data class Tcp(val host: String, val port: Int = 1883, val tls: Boolean = false) : MqttEndpoint

TCP socket connection, used by all non-browser targets.

Connects via raw TCP (or TLS when tls is true) using ktor-network. The standard MQTT ports are 1883 (plain) and 8883 (TLS).

Constructors

Link copied to clipboard
constructor(host: String, port: Int = 1883, tls: Boolean = false)

Properties

Link copied to clipboard

Broker hostname or IP address. Must not be blank.

Link copied to clipboard
val port: Int

TCP port number. Range: 1..65,535. Default: 1883.

Link copied to clipboard

If true, the connection is wrapped in TLS for encryption. Certificate validation uses the platform's default trust store.