The code relied on last_read for the idle time calculation which caused the pings that were written to not reset the idle time. This increased the chance of multiple COM_PING packets being sent to a backend before a reply was received.