summaryrefslogtreecommitdiffstats
path: root/unix
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)
commitdc32232f03c2fa6dfb75ee8ca0ac4767a2a4db12 (patch)
tree9dab06ee4a431cbce0d09dcd6ec74bb036fb5819 /unix
parent26cbbcb5bfbd9c1910f9b51e67983c994f42e196 (diff)
downloadtcl-dc32232f03c2fa6dfb75ee8ca0ac4767a2a4db12.zip
tcl-dc32232f03c2fa6dfb75ee8ca0ac4767a2a4db12.tar.gz
tcl-dc32232f03c2fa6dfb75ee8ca0ac4767a2a4db12.tar.bz2
TIP 468 implementation from Shannon Noe.
Diffstat (limited to 'unix')
-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;