Process Flow - MQTT keep-alive and timeout
Client connects to Broker
Client sends CONNECT with keep-alive
Broker starts keep-alive timer
Client sends PINGREQ before timer expires
Broker receives PINGREQ and resets timer
If no PINGREQ before timer expires
Broker closes connection (timeout)
This flow shows how MQTT clients send a keep-alive value to the broker, which expects periodic PINGREQ messages to keep the connection alive. If the broker does not receive a PINGREQ in time, it closes the connection.