% @(#)backgr.alq	19.1 (ESO-IPG) 02/25/03 14:02:58 
 
Moving a Midas session into background mode means, that no more user
input from the terminal is accepted, but input is obtained from
another Midas session which "connects" to the Midas in background.

SET/BACKGROUND puts the Midas session into background mode and
CLEAR/BACKGROUND (which then has to be sent by another Midas to the session
in background mode) puts it back into the mode where the user can interact 
with Midas via the terminal keyboard again.


The following commands are used by a Midas session which wants to send commands
to anothe Midas session running in parallel and which may be in background 
mode.

CONNECT/BACK_MIDAS  
SHOW/BACK_MIDAS              
WAIT/BACK_MIDAS          
DISCONNECT/BACK_MIDAS Midas_unit

Consult the Help utility for detailed information about these commands.


Different Midas sessions communicate via two possible methods:
a) via local/remote sockets 
b) via ASCII files


a) Communication via sockets is based on the low level `osx' host system 
   interfaces which are part of the Midas release. 
   These `osx' routines are also the basis for the standard XC routines of 
   the Midas Environment. Thus you could write your own applications to 
   communicate with a running Midas session. For details see the Midas 
   Environment document.

b) Communication via ASCII files is based on a simple scheme:
   The client Midas (the one which issues a CONNECT/BACK_MIDAS command)
   places a "sendbox" into the MID_WORK directory.
   This sendbox has the name "FORGRxy.SBOX" with xy the Midas unit of the
   Midas server session (the one we want to connect to).
   The sendbox is an ASCII file with one line. The first 2 chars. are
   the Midas unit of the client Midas (sender) and followed (without space)
   by the command which should be executed by the server Midas.
   The server Midas extracts the sender unit and processes the command.
   Upon termination it creates a "receivebox" in MID_WORK, an ASCII file
   with the name "FORGRxyab.RBOX" with xy the Midas unit of the server and 
   ab the unit of the client (sender) Midas.
   It consists of a single line:
   Status = d1,d2
   with d1 termination status of the command and d2 the return status of
   the server Midas.

   Example:
   Assume, we have Midas session 00 and 34 running on the same host.
   If session 00 uses 34 as a background server and communicates via ASCII
   files, then for sending e.g. the command "READ/KEYW inputc" from the
   client to the server the following files would be written into MID_WORK:
   FORGR34.SBOX   written by unit 00 and containing: 00read/keyw inputc
   FORGR3400.RBOX written by unit 34 and containing: Status = 0,0

