summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixSock.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2017-04-09 14:32:26 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2017-04-09 14:32:26 (GMT)
commitd64611a414a4e8609b17ae27dc02969200d2fa37 (patch)
tree9dab06ee4a431cbce0d09dcd6ec74bb036fb5819 /unix/tclUnixSock.c
parentff4b11441b14dae3eb536004db30a89fa64e365a (diff)
downloadtcl-d64611a414a4e8609b17ae27dc02969200d2fa37.zip
tcl-d64611a414a4e8609b17ae27dc02969200d2fa37.tar.gz
tcl-d64611a414a4e8609b17ae27dc02969200d2fa37.tar.bz2
TIP 468 implementation from Shannon Noe.
Diffstat (limited to 'unix/tclUnixSock.c')
-rw-r--r--unix/tclUnixSock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 9387d05..1e80799 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -1425,6 +1425,7 @@ Tcl_OpenTcpServerEx(
const char *service, /* Port number to open. */
const char *myHost, /* Name of local host. */
unsigned int flags, /* Flags. */
+ int backlog, /* Length of OS listen backlog queue. */
Tcl_TcpAcceptProc *acceptProc,
/* Callback for accepting connections from new
* clients. */
@@ -1584,7 +1585,10 @@ Tcl_OpenTcpServerEx(
chosenport = ntohs(sockname.sa4.sin_port);
}
}
- status = listen(sock, SOMAXCONN);
+ if (backlog < 0) {
+ backlog = SOMAXCONN;
+ }
+ status = listen(sock, backlog);
if (status < 0) {
if (howfar < LISTEN) {
howfar = LISTEN;