examples/common_components: iperf: fix closing of client socket in TCP server mode

Details of the problem : After iperf ended, the socket was not closed, resulting in the WIFI buffer not being released.
This commit is contained in:
xueyunfei
2022-03-02 18:12:59 +08:00
parent 6e0308d352
commit dc06c31a58

View File

@@ -241,6 +241,10 @@ static esp_err_t IRAM_ATTR iperf_run_tcp_server(void)
socket_recv(client_socket, listen_addr, IPERF_TRANS_TYPE_TCP);
exit:
if (client_socket != -1) {
close(client_socket);
}
if (listen_socket != -1) {
shutdown(listen_socket, 0);
close(listen_socket);