You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/03/15 10:01:12 UTC
[incubator-nuttx-apps] 03/04: fix: iperf can not exit when stop
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
commit 5e22b6f5649a54872ddff9f93e8cfb3f0ae883ff
Author: zhanghongyu <zh...@xiaomi.com>
AuthorDate: Mon Feb 28 21:22:25 2022 +0800
fix: iperf can not exit when stop
Signed-off-by: zhanghongyu <zh...@xiaomi.com>
---
netutils/iperf/iperf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/netutils/iperf/iperf.c b/netutils/iperf/iperf.c
index 44b362c..5261c63 100644
--- a/netutils/iperf/iperf.c
+++ b/netutils/iperf/iperf.c
@@ -388,6 +388,7 @@ static int iperf_run_tcp_server(void)
iperf_start_report();
t.tv_sec = IPERF_SOCKET_RX_TIMEOUT;
+ t.tv_usec = 0;
setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &t, sizeof(t));
}
@@ -476,6 +477,7 @@ static int iperf_run_udp_server(void)
printf("want recv=%d", want_recv);
t.tv_sec = IPERF_SOCKET_RX_TIMEOUT;
+ t.tv_usec = 0;
setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &t, sizeof(t));
while (!s_iperf_ctrl.finish)