lsend [-ghlVX] [task]gsend [-ghlVX] [task]
The lsend utility attaches to a running Gamma program and allows the user to send commands without exiting the event loop of the attached process. Any statement may be issued, including changing the definitions of existing functions. lsend statements use Lisp syntax, which consists of the name of the command or function, followed by a space-separated list of arguments, all enclosed in parentheses, like this:
(command arg1 arg2 arg3 ...) (function arg1 arg2 arg3 ...)
The gsend utility is simply a symbolic link to lsend, and is the equivalent of calling lsend with the -g option. gsend statements use Gamma syntax, which is slightly different from Lisp syntax. The command or function name is outside the parentheses, and the arguments are separated by commas, like this:
command (arg1, arg2, arg3, ...) function (arg1, arg2, arg3, ...)
To exit lsend or gsend, use Ctrl-C or Ctl-D. Anything else you type will be parsed and passed on to the task you have been communicating with.
Event processing stops in the Gamma program for the duration of either of these commands.
Sending a Lisp command to an example Gamma process named OtherProcess:
[sh]$ lsend "OtherProcess" OtherProcess> (cos 5.5) 0.70866977429126 OtherProcess>
Sending a Gamma command to the same process:
[sh]$ gsend "OtherProcess" OtherProcess>cos (5.5) 0.70866977429126 OtherProcess>
The example process:
Gamma> init_ipc ("OtherProcess"); t Gamma> while(t) next_event();
It is possible to send several commands at once, by typing them one after another. Here is an example using lsend with the Cascade Historian, running under the task name Hist:
[sh]$ lsend Hist Hist> (disable p*)(enable ptbogus)(history p6) t Hist> (error "histdb: enable: No history found for: ptbogus") Hist> t Hist>
lsend sends commands and shows the return values until all the commands have been attempted. Each command is processed separately by the Cascade Historian. lsend displays a prompt and the return value for each command separately.
See the Sending Commands section of the Cogent Tools Demo for another example of this command in use.
Copyright © 1995-2006 by Cogent Real-Time Systems, Inc. All rights reserved.