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.
Этот коммит содержится в:
родитель
0778f04c98
Коммит
901ad59c83
@ -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;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user