CocoaMQTT是用于iOS和OSX的MQTT客户端,用Swift编写。
目前支持MQTT3.1(不是MQTT3.1.1)
使用:
let mqtt = CocoaMQTT(clientId: "CocoaMQTT-ClientId")mqtt.username = "test"mqtt.password = "public"mqtt.willMessage = CocoaMQTTWill(topic: "/will", message: "dieout")mqtt.keepAlive = 5mqtt.delegate = CocoaMQTTCli()mqtt.connect()
评论