emqx / CocoaMQTT

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

fix variable is_internal_disconnected errors #466

Closed ckfear closed 1 year ago

ckfear commented 2 years ago

fix the issue #465

troupmar commented 1 year ago

Just ran into this today as well. Any progress on the merging process here? @leeway1208

leeway1208 commented 1 year ago

Hi troupmar, 😄 I tested the logic of calling the disconnect() method and it will not cause reconnection, unless mqtt!.autoReconnect = true is set, is there any difference on your side?

troupmar commented 1 year ago

Yes, that is right. However I do not assume the re-connection should happen (even when the autoReconnect is set to true) if I explicitly call the disconnect() method. It should only happen if the disconnection happens internally. Or am I missing something?

leeway1208 commented 1 year ago

Haha got it, good idea, I will discuss with my colleagues. Thanks