Hi Below is my code for establishing mqtt connection over websocket.
For code below i am getting Connection Closed by broker and then connection is closed.
Kindly help.
var sessionManager = MQTTSessionManager()
var serieID:Int = 265
Unfortunately websocket transport is not supported for MQTTSessionManager. You will need to manually create MQTTSession and set transport property to instance of MQTTWebsocketTransport.
Hi Below is my code for establishing mqtt connection over websocket. For code below i am getting Connection Closed by broker and then connection is closed. Kindly help.
sessionManager.connect(to: "apidev.cloudtimer.nl", port: 1883, tls: false, keepalive: 60, clean: true, auth: false, user: nil, pass: nil, will: false, willTopic: nil, willMsg: nil, willQos: .atMostOnce, willRetainFlag: true, withClientId: nil ) sessionManager.delegate = self sessionManager.session.protocolLevel = .version311 sessionManager.session.delegate = self