Skip to content

Commit

Permalink
server move close stream socket to the last like client side
Browse files Browse the repository at this point in the history
Change-Id: I2157e78e3cfd528c6922ec39319470ab6ea3180d
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
  • Loading branch information
xiaoxiang781216 committed Sep 17, 2022
1 parent f088809 commit 7c5129e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/iperf_server_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,6 @@ iperf_handle_message_server(struct iperf_test *test)
test->done = 1;
cpu_util(test->cpu_util);
test->stats_callback(test);
SLIST_FOREACH(sp, &test->streams, streams) {
FD_CLR(sp->socket, &test->read_set);
FD_CLR(sp->socket, &test->write_set);
close(sp->socket);
}
test->reporter_callback(test);
if (iperf_set_send_state(test, EXCHANGE_RESULTS) != 0)
return -1;
Expand All @@ -218,6 +213,11 @@ iperf_handle_message_server(struct iperf_test *test)
return -1;
if (test->on_test_finish)
test->on_test_finish(test);
SLIST_FOREACH(sp, &test->streams, streams) {
FD_CLR(sp->socket, &test->read_set);
FD_CLR(sp->socket, &test->write_set);
close(sp->socket);
}
break;
case IPERF_DONE:
break;
Expand Down

0 comments on commit 7c5129e

Please sign in to comment.