I have a client written using the Mosquitto client library that emits a large number of messages very quickly. The broker cannot keep up, so the outgoing message queue in the client becomes large. This happens, for example, during initial connection when all the retained messages are queued at once. When that happens, the keepalive messages join the end of the queue and are delivered quite late, causing the connection to be dropped due to a keepalive timeout. There is plenty of traffic on the connection, and there is no actual reason to declare a timeout.
Can the algorithm that determines a timeout be modified to (optionally?) treat any incoming data as evidence of a valid connection instead of relying exclusively on the ping/pong messages? I guess this would violate the spec, but it would be a valuable deviation that could be off by default.