Performance improvement - only put socket fd's into the appropriate
fdset, not into both sets.
Этот коммит содержится в:
родитель
979405373d
Коммит
96feeac5a4
@ -38,8 +38,10 @@ iperf_create_streams(struct iperf_test *test)
|
|||||||
if ((s = test->protocol->connect(test)) < 0)
|
if ((s = test->protocol->connect(test)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
FD_SET(s, &test->read_set);
|
if (test->sender)
|
||||||
FD_SET(s, &test->write_set);
|
FD_SET(s, &test->write_set);
|
||||||
|
else
|
||||||
|
FD_SET(s, &test->read_set);
|
||||||
if (s > test->max_fd) test->max_fd = s;
|
if (s > test->max_fd) test->max_fd = s;
|
||||||
|
|
||||||
sp = iperf_new_stream(test, s);
|
sp = iperf_new_stream(test, s);
|
||||||
|
@ -499,8 +499,10 @@ iperf_run_server(struct iperf_test *test)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
FD_SET(s, &test->read_set);
|
if (test->sender)
|
||||||
FD_SET(s, &test->write_set);
|
FD_SET(s, &test->write_set);
|
||||||
|
else
|
||||||
|
FD_SET(s, &test->read_set);
|
||||||
if (s > test->max_fd) test->max_fd = s;
|
if (s > test->max_fd) test->max_fd = s;
|
||||||
|
|
||||||
streams_accepted++;
|
streams_accepted++;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user