iperf: test->ctrl_sck exists per test not a stream.
authorEunBong Song <eunb.song@samsung.com>
Mon, 7 Aug 2017 22:14:27 +0000 (15:14 -0700)
committerEunBong Song <eunb.song@samsung.com>
Wed, 30 Aug 2017 04:15:49 +0000 (21:15 -0700)
iperf_client_end tries to close test->ctrl_sck per stream.
This is not correct because test->ctrl_sck exists per test.

Change-Id: I2a29de218381fe84dcfdc60a82be0d769341de2b
Signed-off-by: EunBong Song <eunb.song@samsung.com>
apps/examples/iperf/iperf_client_api.c

index 83621f2..78cc763 100644 (file)
@@ -347,10 +347,11 @@ int iperf_client_end(struct iperf_test *test)
 
        iperf_set_send_state(test, IPERF_DONE);
 
+       close(test->ctrl_sck);
+
        /* Close all stream sockets */
        SLIST_FOREACH(sp, &test->streams, streams) {
                close(sp->socket);
-               close(test->ctrl_sck);
        }
 
        return 0;