summaryrefslogtreecommitdiffstats
path: root/generic/tclIOSock.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-04 14:05:20 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-04 14:05:20 (GMT)
commit1297b4be9b37d8c39cb9bd2f8451c1b69bc6fa13 (patch)
tree690246b6abf3458ded10e0293e2c086f894d77ef /generic/tclIOSock.c
parent328461c6cf73105f97aee07048a22741b4d2cc2b (diff)
parent6c67fa6248b76a800bbd47bdc27bfec84e1f0de4 (diff)
downloadtcl-1297b4be9b37d8c39cb9bd2f8451c1b69bc6fa13.zip
tcl-1297b4be9b37d8c39cb9bd2f8451c1b69bc6fa13.tar.gz
tcl-1297b4be9b37d8c39cb9bd2f8451c1b69bc6fa13.tar.bz2
Merge trunk. First steps in eliminating "source -nopkg". Some test-cases still fail.
Diffstat (limited to 'generic/tclIOSock.c')
-rw-r--r--generic/tclIOSock.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c
index 7ed751c..8ad268a 100644
--- a/generic/tclIOSock.c
+++ b/generic/tclIOSock.c
@@ -285,6 +285,34 @@ TclCreateSocketAddress(
}
/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_OpenTcpServer --
+ *
+ * Opens a TCP server socket and creates a channel around it.
+ *
+ * Results:
+ * The channel or NULL if failed. If an error occurred, an error message
+ * is left in the interp's result if interp is not NULL.
+ *
+ * Side effects:
+ * Opens a server socket and creates a new channel.
+ *
+ *----------------------------------------------------------------------
+ */
+Tcl_Channel Tcl_OpenTcpServer(Tcl_Interp *interp, int port,
+ const char *host, Tcl_TcpAcceptProc *acceptProc,
+ ClientData callbackData)
+{
+ char portbuf[TCL_INTEGER_SPACE];
+
+ TclFormatInt(portbuf, port);
+
+ return Tcl_OpenTcpServerEx(interp, portbuf, host, TCL_TCPSERVER_REUSEADDR,
+ acceptProc, callbackData);
+}
+
+/*
* Local Variables:
* mode: c
* c-basic-offset: 4