1
1

tcp sctp: Let the system pick the largest possible backlog value for listen() (#827)

This commit applies the same changes made by b481169 (#693), to the
TCP and SCTP server sockets.
Этот коммит содержится в:
Frank LENORMAND 2018-12-13 21:32:49 +00:00 коммит произвёл Bruce A. Mah
родитель 0778f04c98
Коммит 901ad59c83
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -37,6 +37,7 @@
#include <netdb.h> #include <netdb.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/select.h> #include <sys/select.h>
#include <limits.h>
#ifdef HAVE_NETINET_SCTP_H #ifdef HAVE_NETINET_SCTP_H
#include <netinet/sctp.h> #include <netinet/sctp.h>
@ -234,7 +235,7 @@ iperf_sctp_listen(struct iperf_test *test)
freeaddrinfo(res); freeaddrinfo(res);
if (listen(s, 5) < 0) { if (listen(s, INT_MAX) < 0) {
i_errno = IESTREAMLISTEN; i_errno = IESTREAMLISTEN;
return -1; return -1;
} }

Просмотреть файл

@ -35,6 +35,7 @@
#include <netdb.h> #include <netdb.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/select.h> #include <sys/select.h>
#include <limits.h>
#include "iperf.h" #include "iperf.h"
#include "iperf_api.h" #include "iperf_api.h"
@ -301,7 +302,7 @@ iperf_tcp_listen(struct iperf_test *test)
freeaddrinfo(res); freeaddrinfo(res);
if (listen(s, 5) < 0) { if (listen(s, INT_MAX) < 0) {
i_errno = IESTREAMLISTEN; i_errno = IESTREAMLISTEN;
return -1; return -1;
} }