MqttTransportFactory
interface MqttTransportFactory
Creates the MqttTransport for a given MqttEndpoint.
This is the seam that lets :core stay free of any concrete transport dependency: each transport module (mqtt-client-transport-tcp, mqtt-client-transport-ws) ships a factory, and the consumer supplies one via MqttConfig.Builder.transportFactory. Factories that handle different endpoint types can be combined with plus:
val client = MqttClient("sensor") {
transportFactory = TcpTransportFactory() + WebSocketTransportFactory()
}Content copied to clipboard
Functions
Link copied to clipboard
Create a fresh, unconnected MqttTransport for endpoint.
Link copied to clipboard
Combine two factories into one that delegates to whichever supports the endpoint, trying the left-hand factory first. Use this to accept more than one endpoint type (e.g. both TCP and WebSocket) from a single client.
Link copied to clipboard
Whether this factory can create a transport for endpoint.