emqx / CocoaMQTT

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

Why should the message qos of dup=0 be set to qos0? #551

Open HWDW opened 10 months ago

HWDW commented 10 months ago

I don’t understand why the message qos of dup=0 should be set to qos0 @discardableResult public func publish(_ topic: String, withString string: String, qos: CocoaMQTTQoS = .qos1, DUP: Bool = false, retained: Bool = false, properties: MqttPublishProperties) -> Int { var fixQus = qos if !DUP{ fixQus = .qos0 } let message = CocoaMQTT5Message(topic: topic, string: string, qos: fixQus, retained: retained) return publish(message, DUP: DUP, retained: retained, properties: properties) }