I have been using the following code segment in a CGI I have for years.
It send a message to another DVM and waits for a reply. I know you didn't
want an PIPE stage but in case you changed your mind. I am no pipe expect
so I am sure it can be written much nicer but it works!
Aria
address command 'CP SET MSG IUCV'
ADDRESS COMMAND 'PIPE (end ? name SendRequest)',
' hole',
'| literal +5', /* wait max of 5 sec */
'| delay',
'| g: gate', /* Shut the gate */
'? starmsg *MSGALL', /* wait for messages */
'| g:', /* Until the interval expires */
'| specs w2-* 1', /* remove the id part. */
'| var reply',
'| pipestop', /* stop when we got a reply */
'? hole', /* ask DVM in 1 sec. to be sure we are listening */
'| literal SMSG _dvmid_ _dvmCommand_' ,
'| CP', /* send message to DVM */
'| hole'
On Thu, 11 Dec 2008 15:47:13 +0100 Colin Allinson said:
>
>I am working with a Web CGI script and need to request information off
>another Virtual machine and get a synchronous response back (eg: in a
>PIPE).
>
>I could use REXEC but this could be a bit cludgey for a number of reasons
>(mainly to do with checking the userid in not logged on at the time).
>
>I could try pre-building the data into a filepool directory and retrieving
>it from there but the data is fairly dynamic so it would need to be
>rebuilt constantly.
>
>The CA routines for running an EXEC on another user and getting the output
>seem to need a logon first (this will be a widely used page and public
>data)
>
>I could get into a complicated PIPE in the CGI script that waits on a
>STARMSG with a time-out breaking the GATE but I would prefer not to do
>that.
>
>I am convinced that I am missing something very obvious - but I cannot
>think what.
>
>Does anyone have any ideas??
>
>Colin Allinson
>
>Amadeus Data Processing GmbH
>