From 63ed429a49e0fc9658f0cef80b9d9dd68c592214 Mon Sep 17 00:00:00 2001 From: yuanjm Date: Thu, 16 Jun 2022 09:41:51 +0800 Subject: [PATCH] fix(example): Fix wss_server_example not close socket Closes https://github.com/espressif/esp-idf/issues/9163 --- .../https_server/wss_server/main/wss_server_example.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/protocols/https_server/wss_server/main/wss_server_example.c b/examples/protocols/https_server/wss_server/main/wss_server_example.c index 57ed2c9d1c..bc94f2025e 100644 --- a/examples/protocols/https_server/wss_server/main/wss_server_example.c +++ b/examples/protocols/https_server/wss_server/main/wss_server_example.c @@ -15,7 +15,7 @@ #include "esp_netif.h" #include "esp_eth.h" #include "protocol_examples_common.h" - +#include "lwip/sockets.h" #include #include "keep_alive.h" #include "sdkconfig.h" @@ -111,6 +111,7 @@ void wss_close_fd(httpd_handle_t hd, int sockfd) ESP_LOGI(TAG, "Client disconnected %d", sockfd); wss_keep_alive_t h = httpd_get_global_user_ctx(hd); wss_keep_alive_remove_client(h, sockfd); + close(sockfd); } static const httpd_uri_t ws = {