Overview:

tclTCP is a library that allows TCL based applications to
communicate via TCP/IP, without using Tk's "send" command.
tclTCP is an extension to Tk/TCL, and does not require patching the 
TCL or Tk sources.  In contrast to tcl-dp, tclTCP does NOT require Tk and X. 


As part of its implementation, tclTCP provides a simple event handling 
capability for TCL applications to handle file I/O and "whenIdle" calls.
(It does not provide timer handling.)

Note that non-TCL applications can send commands to a TCL interpreter 
via a socket if the TCL application uses tclTCP.

	
	TCP/IP clients and servers for TCL -- Installation Instructions



Files on this tape:

README		- This file
Makefile.noimake	- Makefile for the TCL-TCP/IP interface
Imakefile	- for use with imake (xmkmf)
simple.c	- Test program for the TCP/IP interface
src/Makefile.noimake	- Makefile for the TCL-TCP/IP interface
src/tclTCP.c	- Source code to the TCP/IP interface
src/tclTCP.h	- Header file describing the TCP/IP interface
src/simpleEvent.c	- event handling for non-TK programs
src/svrStrmSock.c	- server side of TCP socket utilities
src/clntStrmSock.c	- client side of TCP socket utilities
src/readFullBuf.c	- tcp/ip utility
src/tcltcp_init.c 	- contains initializion functions for this package.
tcp.man		- Man page for the TCP/IP interface

demos		- Subdirectory containing a set of demonstration programs.

Instructions:

- Unpack this package, preferably under the same parent directory that
contains your TCL and TK distributions.  Create symbolic links in the
parent directory for your TCL and Tk directories, like:
% ln -s tcl7.5 tcl
% ln -s tk4.1 tk


- If you have "imake", edit Imakefile, setting TCL_INCDIR and TK_INCDIR and 
  build your makefile, using the following steps; 
  % xmkmf  
  % make Makefiles
  % make

  This is the preferred solution, since it builds shared libraries for tclTCP.


- Otherwise, 
  % cp Makefile.noimake Makefile
  % cp src/Makefile.noimake src/Makefile
  Edit as necessary for your system.  On system 5 machines, set 
  RANLIB=echo
  If you need to use a -I option for cc to find <tcl.h> and <tk.h>, 
  add it to the CFLAGS= line.
  If you need a -L option for the loader to find libtcl.a and libtk.a, add it
  to the LDFLAGS= line.


- Type `make' to make the whole package.

- For a simple test of the server interface, type `./simple&'.  This command
  will start a Tcl interpreter running as a server in the background.  You
  can connect to the server by typing `telnet localhost 2323'.  You can type
  Tcl commands to the background server, and type the command, `bye' when you
  are done playing with it.

- A broader set of demos is contained in the `demos' subdirectory.  To try
  them, cd to the `demos' subdirectory and type the command:
	dodemo
  This will start a server in the background that contains a simple Tcl program
  that maintains a color, along with a few clients that show the color
  value and let you change the value.


  Try changing the color using `entries', or `colortab', and notice that
  all the other views change in synchrony.  (By the way, note also that you
  can have multiple copies of the various clients in execution at once.)

  When you're done, hit the `Quit' button on each client and the server.

  (Note - unfortunately, these demos occasionally deadlock, when two 
  TCL interpreters simulataneously make requests of each other.  
  I haven't had time to find a reliable solution to avoid these
  deadlocks.  See the WARNING at the bottom of this file.

- You're now ready to add the TCP/IP support to your own Tcl applications.
  Look at simple.c and tkAppInit.c for the TkTCP_Init() or TclTCP_Init() call 
  that installs the TCP support in the interpreter.  
  It's that simple.  Note that
  libtclTCP.a is provided for TCL only applications, while libtkTCP.a is
  provided for TCL/Tk applications.


Please direct correspondence on this package to 

Joe VanAndel (vanandel@ucar.edu) who ported it to TCL7.3, Tk3.6

This package originally authored by Kevin B. Kenny of General Electric.



THINGS TO DO FOR THE NEXT RELEASE:
	
	- Allow for specifying ports by service name instead of
	  number.

	- (Maybe) Allow Unix-domain sockets as well as AF_INET.

	- Allow for servers started by inetd.

WARNING:
    This package has a known deadlock if two tasks send to each other
    at precisely the same time, since each task will be waiting for
    a response from the other.  This is not a problem if you maintain
    a "master-slave" relationship, rather than having independent peers,
    that each can send commands to each other.
