Chapter 17. The tcl server application

TclServer is a deceptively simple program. It is a wish (Tk) interpreter that allows Tcp/IP connections from a local or remote client. Once connected, the client can send messages consisting of Tcl commands and receive the result of executing those commands from the server.

TclServer is used as the basis of a number of applications in the NSCLDAQ system including the scaler display program, the epicsdisplay program and other software written by specific groups. Tcl servers can be used as distributed data repositories (store data in server Tcl variables and/or arrays and get them back out), or as display programs that can be remote-controlled. The production readout framework has a Tcl Server component that can be enabled.

This chapter contains: A description of the TclServer protection model. For complete information about the TclServer see the TclServer reference pages .

The TclServer protection model is not very stringent. The assumption is that TclServers can only be reached by trusted systems. Specifically systems that have not been broken into and will not spoof host names. When a TclServer starts, it will only allow connections from localhost.

The TclServer extends the Tcl/Tk command set with the command serverauth this command allows you to authorize additional systems to connect to the server. The complete form of the serverauth command is described in the reference page for the serverauth command.. section.

The following command adds the node spdaq20.nscl.msu.edu to the set of hosts that are allowed to connnect to the server.

Example 17-1. Using serverauth to authorize a node


serverauth add spdaq20.nscl.msu.edu
            

17.1. Tcl server package

TclServer is also available as a package that can be incorporated into Tcl scripts. For information about that, see: TclServer