emqx / CocoaMQTT

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

CocoaMQTT state is always contecting #355

Open renjunok opened 3 years ago

renjunok commented 3 years ago

let clientID = "CocoaMQTT-" + String(ProcessInfo().processIdentifier) let mqtt = CocoaMQTT(clientID: clientID, host: "192.168.1.10", port: 1883) mqtt.logLevel = .debug mqtt.username = "test" mqtt.password = "public" mqtt.willMessage = CocoaMQTTWill(topic: "/will", message: "dieout") mqtt.keepAlive = 60 mqtt.delegate = self mqtt.connect()

func mqtt(_ mqtt: CocoaMQTT, didStateChangeTo state: CocoaMQTTConnState) { print("current state is: (state)") }

state is always contecting Use golang client to connect normally xcode 12.3, swift5.3

WPHU-nuvoton commented 3 years ago

I have the same problem.

Version 12.4 ,swift5.3.2

Pikdays commented 3 years ago

I have the same problem.

fhainz commented 2 years ago

Same problem here

leeway1208 commented 2 years ago

Please check the broker configuration again. Maybe the problem can be solved. Or you can use free broker(broker-cn.emqx.io port:1883) to test.