Remote Tcl Interface

# Chapter 6 Remote Tcl Interface

This chapter describes the remote Tcl interface, which allows a separate external Tcl program to interact with ECLiPSe in much the same fashion as the embedding Tcl interface (see chapter 5). Like the embedding interface, Tcl and ECLiPSe code communicates by sending and receiving streams of bytes via I/O queues (the ec_rpc mechanism is implemented on top of these queues). The interface can thus be used in similar fashion to the embedding interface, e.g. for the development of graphical user interfaces to an ECLiPSe application, with the difference that the ECLiPSe program is a separate program and not embedded into the Tcl program.

The main features of the interface are:

- The connection between the Tcl and ECLiPSe processes are established via sockets using TCP network protocol. Thus the Tcl process can be run on a different machine and platform from the ECLiPSe process.
- The Tcl process can be attached to any running ECLiPSe process, including an ECLiPSe embedded into another host language.
- More than one Tcl (or other remote) process can be attached to a single ECLiPSe via the remote interface.
- For the programmer, the embedding and remote interfaces are largely similar, and once the connection is established in the remote interface, the same code on the ECLiPSe and Tcl sides can be used for both interfaces.

The remote interface thus offers more flexibility than an embedding interface in how the Tcl code can be connected to an ECLiPSe program. However, as the Tcl and ECLiPSe processes are not as tightly coupled as in an embedded interface, the speed of communications between the Tcl and ECLiPSe processes is likely to be slower.

- Basic Concepts of the Interface
- Loading the Interface
- Attaching and Initialising the Interface
  - A Note on Security
- Type Conversion Between Tcl and ECLiPSe
- Executing an ECLiPSe Goal From Tcl
- Communication via Queues
  - Queue Data Handlers
  - Synchronous Queues
  - Asynchronous Queues
  - Reusable Queue Names
  - Translating the Queue Names
- Additional Control and Support
  - Initialisation During Attachment
  - Disconnection and Control Transfer Support
- Example
- Differences From the Tcl Embedding Interface