njh / ruby-mqtt

Pure Ruby gem that implements the MQTT protocol, a lightweight protocol for publish/subscribe messaging.
http://www.rubydoc.info/gems/mqtt
MIT License
538 stars 135 forks source link

MQTT client on weak CPU and high traffic environment #127

Open cosmo0920 opened 3 years ago

cosmo0920 commented 3 years ago

When flood of messages are reached in this client on weak CPU environment, keep_alive! response may not reached until response timeout and causes MQTT::ProtocolException with "No Ping Response received for xxx seconds":

Protocol error occurs in in_mqtt.,MQTT::ProtocolException,No Ping Response received for 23 seconds
/media/Data2/Gitrepo/ruby-mqtt/lib/mqtt/client.rb:541:in `keep_alive!'
/media/Data2/Gitrepo/ruby-mqtt/lib/mqtt/client.rb:474:in `receive_packet'
/media/Data2/Gitrepo/ruby-mqtt/lib/mqtt/client.rb:272:in `block in connect'