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.
diff --git a/src/iperf_sctp.c b/src/iperf_sctp.c
index 810cac4..c1cb134 100644
--- a/src/iperf_sctp.c
+++ b/src/iperf_sctp.c
@@ -37,6 +37,7 @@
#include <netdb.h>
#include <sys/time.h>
#include <sys/select.h>
+#include <limits.h>
#ifdef HAVE_NETINET_SCTP_H
#include <netinet/sctp.h>
@@ -234,7 +235,7 @@
freeaddrinfo(res);
- if (listen(s, 5) < 0) {
+ if (listen(s, INT_MAX) < 0) {
i_errno = IESTREAMLISTEN;
return -1;
}
diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c
index e16203a..f6ef78f 100644
--- a/src/iperf_tcp.c
+++ b/src/iperf_tcp.c
@@ -35,6 +35,7 @@
#include <netdb.h>
#include <sys/time.h>
#include <sys/select.h>
+#include <limits.h>
#include "iperf.h"
#include "iperf_api.h"
@@ -301,7 +302,7 @@
freeaddrinfo(res);
- if (listen(s, 5) < 0) {
+ if (listen(s, INT_MAX) < 0) {
i_errno = IESTREAMLISTEN;
return -1;
}