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

Auto-reconnect is attempted even when the mqtt session is manually terminated by the client. #350

Open BrentMifsud opened 4 years ago

BrentMifsud commented 4 years ago

Here are some steps to reproduce:

  1. create a new CocoaMQTT instance
  2. enable autoreconnect
  3. connect to a broker
  4. trigger the CocoaMQTT.disconnect() method
  5. notice that the CocoaMqtt.connect() method is triggered shortly after.

Workaround I have been using:

  1. set autoreconnect to false
  2. call disconnect()

Not sure if this is intentional functionality or not.

nrlnishan commented 2 years ago

I'm also facing the same issue. Using the same workaround as yours.