Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: Creating and Controlling Remote Clients Up: Internals Previous: Internals


Encoding Event Values

Communication between Glish and clients is handled by a data transport layer called SOS. SOS is a library that provides platform independent transport of binary data between different machines, e.g. data can be moved from a SPARC machine to an ALPHA machine transparently. Any necessary conversion is done at the receiving end of the communication. This avoids unnecessary conversion on some architectures. SOS is a reimplementation in C++ of a portion of another transport library called SDS (contact Chris Saltmarsh at salty@farpoint.co.uk for more information about SDS).

The header portion of each event encodes information such as the architecture of the machine that sent the event, a time stamp, length of the event, etc. The interface to the event header is defined in the C++ header file <sos/header.h>. The header is followed by the actual event data.

The header information and binary values are written to and read from SOS sinks and sources. These are C++ objects which provide an I/O abstraction that allows you to read and write values from and to file descriptors, e.g. the pipes or sockets which connect Glish to clients. The header file <sos/io.h> defines the interface for SOS sources and sinks.

For the most part, Glish's dependence on the transport layer is isolated in two functions send_event() and recv_event(). Both are found in Client.cc. These routines are parameterized with SOS source and sink objects. This is necessary to allow events being sent by the interpreter to be non-blocking. When used by the interpreter, send_event() sends what it can and the returns under the assumption that it will resume later. This eliminates some deadlock situations.


next up previous contents index
Next: Creating and Controlling Remote Clients Up: Internals Previous: Internals   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15