bluerhinos / phpMQTT

a simple php class to connect/publish/subscribe to a MQTT broker
Other
773 stars 460 forks source link

Resolve issue with ping timeout #42 #89

Closed SergeyBrook closed 4 years ago

SergeyBrook commented 4 years ago

As commented in bluerhinos#42: It seems that Mosquitto broker expecting to receive ping within timeout period regardless of messages sent to client within this period of time (not tested this behavior on other brokers). In "proc" method, "timesinceping" updated when EVERY type of message being received, not only ping response and this causes to delay next ping to broker. This, in turn, cause to timeout on broker side and it forcing to close connection. Additionally, resolves the problem when ping is sent twice every time.