eclipse / paho.mqtt.m2mqtt

Eclipse Public License 1.0
512 stars 303 forks source link

Not detect when disconnect #65

Closed serkanayaz closed 6 years ago

serkanayaz commented 6 years ago

Hi,

Library is not detect when disconnect.

Scenario: Library is connect to any mqtt server and internet is disconnect (or disable wifi). Now, Should be run Mqtt_ConnectionClosed event but not run.

Best regard.

serkanayaz commented 6 years ago

Sorry, it is detect when disconnected, but after long time.

Salma175 commented 6 years ago

close this issue

serkanayaz commented 6 years ago

I need a mechanism where I can set the KeepAlive field. Or how can I set the KeepAlive field?

Salma175 commented 6 years ago

client.Connect(client_id, userName, password, false, 3) Last parameter is KeppAlive Period

serkanayaz commented 6 years ago

Thank you very much @Salma175 . It works correctly by setting KeepAlive time short.