Skip to content

Commit fe32d8f

Browse files
Merge branch 'docs/clarify_keepalive_timeout' into 'master'
docs: Clarify keepalive timeout See merge request espressif/esp-mqtt!186
2 parents cd81773 + cb1e6cf commit fe32d8f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/mqtt_client.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ typedef struct esp_mqtt_client_config_t {
315315
int retain; /*!< LWT retained message flag */
316316
} last_will; /*!< Last will configuration */
317317
bool disable_clean_session; /*!< *MQTT* clean session, default clean_session is true */
318-
int keepalive; /*!< *MQTT* keepalive, default is 120 seconds */
318+
int keepalive; /*!< *MQTT* keepalive, default is 120 seconds
319+
When configuring this value, keep in mind that the client attempts
320+
to communicate with the broker at half the interval that is actually set.
321+
This conservative approach allows for more attempts before the broker's timeout occurs */
319322
bool disable_keepalive; /*!< Set `disable_keepalive=true` to turn off keep-alive mechanism, keepalive is active
320323
by default. Note: setting the config value `keepalive` to `0` doesn't disable
321324
keepalive feature, but uses a default keepalive period */
@@ -334,7 +337,7 @@ typedef struct esp_mqtt_client_config_t {
334337
bool disable_auto_reconnect; /*!< Client will reconnect to server (when errors/disconnect). Set
335338
`disable_auto_reconnect=true` to disable */
336339
esp_transport_handle_t transport; /*!< Custom transport handle to use. Warning: The transport should be valid during the client lifetime and is destroyed when esp_mqtt_client_destroy is called. */
337-
struct ifreq * if_name; /*!< The name of interface for data to go through. Use the default interface without setting */
340+
struct ifreq * if_name; /*!< The name of interface for data to go through. Use the default interface without setting */
338341
} network; /*!< Network configuration */
339342
/**
340343
* Client task configuration

0 commit comments

Comments
 (0)