emqx / CocoaMQTT

MQTT 5.0 client library for iOS and macOS written in Swift
https://www.emqx.com/en
Other
1.6k stars 422 forks source link

MQTT getting disconnected in every 60 seconds. #336

Open rajeevradhakrish opened 4 years ago

rajeevradhakrish commented 4 years ago

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.

rajeevradhakrish commented 4 years ago

Some time getting error "Connection Closed by remote peer"