next up previous
Next: Encoding data Up: A Distributed LISP-STAT Environment Previous: Communications model

Low-level Lisp interface

The model used is that a process sets itself up to listen for connections at a known location, i.e. on a known machine, and a known `subaddress' called a port. In this situation, it is acting like a server. There are a number of routines that set up such a connection. Firstly socket creates a new socket, returning a handle. This socket is then bound to a port using bind. Finally, the maximum number of queued connection requests is set using listen.

At this point the server is ready for clients to call it, which they do by making a socket and then using the connect function. On the server, the accept function waits until a client makes a call to the specific port, establishes the communication channel, and returns a handle onto the local end of the communication (a new socket). Another client process can then request a connection from this server, by again calling connect with the the machine location and the port number. Once the link has been established, the communication can be two way and can persist as long as necessary, i.e. not in the strict client-server model imposed by RPC.

There are three basic data transfer primitives, corresponding to the three basic types integer, float and string. All other types can be transferred by using these functions or combinations of functions and standard conversions.

Although a LISP-STAT process only has a single thread, it can have more than one connection talking to it. Care has to be taken, since if a read activity is initiated, it will not terminate until the data arrives (the read is said to `block'). A mechanism, based on the UNIX select library call, allows you to identify which connections have data ready to be read on them.


next up previous
Next: Encoding data Up: A Distributed LISP-STAT Environment Previous: Communications model
Danius Michaelides
6/1/1998