README.tclTCP+ Last update: 15Oct94 tclTCP+1.1 supercedes tclTCP+1.0 This file can be found at ftp.wag.caltech.edu:/pub/kis/doc The complete distribution can also be found at ftp.wag.caltech.edu:/pub/kis/bin INTRODUCTION tclTCP+ is an extension of Kevin Kenny's original tclTCP package. The extensions are highlighed with change bars in the on-line man page (tcp.n). The original copyright as well as Parallelograms' copyright appear in various places, including at the end of this file. You are free to use this software however you see fit. Please direct questions to info@pgrams.com tclTCP+ provides the following: 1) TCP/IP connections between Tcl applications for exchanging Tcl strings. 2) Facilities for creating Tcl-based servers spawned from inetd. 3) Facilities for creating Tcl-based script that behave like inetd. 4) Ability to fork off new processes to act as servers. 5) Timer event handling from within Tcl-based applications. These features are implemented as options to a single new Tcl command, "tcp", See the man page for Tcl-level details. VERSION 1.1 Adds -fork option to tcp server command. Adds -nowait option to tcp spawnserver. See man page for details. DESCRIPTION The tcp command gives Tcl-based applications the ability to communicate Tcl strings (data and commands) via TCP/IP socket connections. Applications and shell-interpreters linked with tclTCP+ can communicate with each other and provide TCP/IP based network services. The "timer" suboption allows Tcl-based applications to perform periodic tasks at the expiration of a timer event while still handling TCP/IP I/O. The "inetd" option allows the creation of Tcl-based inetd services. NOTE Some of these things can also be accomplished in slightly different ways using the excellent extended Tcl package by Karl Lehenbauer and Mark Diekhans. See the archive site at harbor.ecn.purdue.edu for information on extended Tcl if you are beginning a programming project with requirements for TCP/IP access, inetd servers, and various event timers. Compare the options available in tclTCP+ and extended Tcl with your requirements. USE To use tclTCP+ in your C or C++ application, add a call to Tcp_Init() in your program. For example, to add tclTCP+ to the standard wish program, add the call to Tcp_Init() after the call to Tk_Init() in tkAppInit.c - the result should look something like this: /* * Call the init procedures for included packages. Each call should * look like this: * * if (Mod_Init(interp) == TCL_ERROR) { * return TCL_ERROR; * } * * where "Mod" is the name of the module. */ if (Tcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } if (Tk_Init(interp) == TCL_ERROR) { return TCL_ERROR; } if (Tcp_Init(interp) == TCL_ERROR) { return TCL_ERROR; } To compile the tclTCP+ files, insert the object files into the list for the standard Tk or Tcl Makefiles. For example, this line shows the changes needed in the tk3.6 Makefile. OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkCmds.o \ tkColor.o tkConfig.o tkCursor.o tkError.o tkEvent.o \ tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o \ tkMain.o tkOption.o tkPack.o tkPlace.o tkPreserve.o tkSelect.o \ tkSend.o tkWindow.o tkWm.o $(WIDGOBJS) \ $(CANVOBJS) $(TEXTOBJS) tclTCP.o simpleEvent_Tk.o COPYRIGHTS: /* "Copyright (C) 1992 General Electric. All rights reserved." ; */ /* * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of General Electric not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * General Electric makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. * * This work was supported by the DARPA Initiative in Concurrent * Engineering (DICE) through DARPA Contract MDA972-88-C-0047. */ /* * Copyright (C) 1992...1994 Parallelograms, P. O. Box AA, Pasadena, * CA 91102. All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear in * supporting documentation, and that the name of PARALLELOGRAMS IS CITED * IN ALL ADVERTISING OR PUBLICITY PERTAINING TO DISTRIBUTION OF THE SOFTWARE. * Parallelograms makes no representations about the suitability of this * software for any purpose. It is provided "as is" without express or * implied warranty. */ Direct questions to info@pgrams.com.