diff --git a/src/mqtt.c b/src/mqtt.c index 97ebc66..14cbbac 100644 --- a/src/mqtt.c +++ b/src/mqtt.c @@ -622,7 +622,7 @@ ssize_t __mqtt_send(struct mqtt_client *client) /* check for keep-alive */ { - mqtt_pal_time_t keep_alive_timeout = client->time_of_last_send + (mqtt_pal_time_t)((float)(client->keep_alive) * 0.75); + mqtt_pal_time_t keep_alive_timeout = client->time_of_last_send + (mqtt_pal_time_t)((float)(client->keep_alive)); if (MQTT_PAL_TIME() > keep_alive_timeout) { ssize_t rv = __mqtt_ping(client); if (rv != MQTT_OK) {