mqttService?.host=configuration.MQTT_SERVER_HOST
mqttService?.port=UInt16(configuration.MQTT_SERVER_PORT)!
mqttService?.willMessage = CocoaMQTTWill(topic: "/will", message: "dieout")
mqttService?.keepAlive = 60
mqttService?.autoReconnect=true
mqttService?.enableSSL = true
mqttService?.delegate=self
mqttService?.cleanSession=false
I have used a keep alive of 60 ,not sure about the reason for disconnection.Try to print the error but it is nil.
Ping is properly sent.
mqttService?.host=configuration.MQTT_SERVER_HOST mqttService?.port=UInt16(configuration.MQTT_SERVER_PORT)! mqttService?.willMessage = CocoaMQTTWill(topic: "/will", message: "dieout") mqttService?.keepAlive = 60 mqttService?.autoReconnect=true mqttService?.enableSSL = true mqttService?.delegate=self mqttService?.cleanSession=false I have used a keep alive of 60 ,not sure about the reason for disconnection.Try to print the error but it is nil. Ping is properly sent.