mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
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:
parent
eff03cbbd9
commit
e00580109b
@ -267,6 +267,10 @@ static esp_err_t IRAM_ATTR iperf_run_tcp_server(void)
|
|||||||
|
|
||||||
socket_recv(client_socket, listen_addr, IPERF_TRANS_TYPE_TCP);
|
socket_recv(client_socket, listen_addr, IPERF_TRANS_TYPE_TCP);
|
||||||
exit:
|
exit:
|
||||||
|
if (client_socket != -1) {
|
||||||
|
close(client_socket);
|
||||||
|
}
|
||||||
|
|
||||||
if (listen_socket != -1) {
|
if (listen_socket != -1) {
|
||||||
shutdown(listen_socket, 0);
|
shutdown(listen_socket, 0);
|
||||||
close(listen_socket);
|
close(listen_socket);
|
||||||
|
Loading…
Reference in New Issue
Block a user