esp_http_server: Add support to enable TCP keepalive config

Closes https://github.com/espressif/esp-idf/issues/9848
This commit is contained in:
yuanjianmin
2022-10-21 15:23:03 +08:00
parent 7278cf3e16
commit e05d61d075
2 changed files with 47 additions and 8 deletions

View File

@@ -42,6 +42,10 @@ initializer that should be kept in sync
.global_transport_ctx_free_fn = NULL, \
.enable_so_linger = false, \
.linger_timeout = 0, \
.keep_alive_enable = false, \
.keep_alive_idle = 0, \
.keep_alive_interval = 0, \
.keep_alive_count = 0, \
.open_fn = NULL, \
.close_fn = NULL, \
.uri_match_fn = NULL \
@@ -189,7 +193,10 @@ typedef struct httpd_config {
bool enable_so_linger; /*!< bool to enable/disable linger */
int linger_timeout; /*!< linger timeout (in seconds) */
bool keep_alive_enable; /*!< Enable keep-alive timeout */
int keep_alive_idle; /*!< Keep-alive idle time. Default is 5 (second) */
int keep_alive_interval;/*!< Keep-alive interval time. Default is 5 (second) */
int keep_alive_count; /*!< Keep-alive packet retry send count. Default is 3 counts */
/**
* Custom session opening callback.
*