Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@last_ping_request and @last_ping_response #107

Open
crawler opened this issue Dec 8, 2017 · 0 comments
Open

@last_ping_request and @last_ping_response #107

crawler opened this issue Dec 8, 2017 · 0 comments

Comments

@crawler
Copy link

crawler commented Dec 8, 2017

Hi,
Found this issue when i was writing code that recovers broken MQTT connection.
Think that both @last_ping_request and @last_ping_response variables should be reset in #connect method, just before starting @read_thread

Here the code to reproduce it:

mqtt = MQTT::Client.new('mqtt://test.mosquitto.org')
sleep 24
mqtt.connect
mqtt.subscribe('#')

mqtt.get do |topic, payload| 
  puts topic, payload
end # => No Ping Response received for 23 seconds (MQTT::ProtocolException)
# In first keep_alive!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant