× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'm trying to test an IPC Interprocess Communication from an ILE RPG
Program and a remote (Linux) program through an SSH channel.

The idea is to have an RPG program that run in SPAWN "a call" to a remote
Linux program via SSH and communicates with it via messages on
STDIN/STDOUT, keeping the session active (stateful).

I found a great Scott Klement Example (Spawn Pase) somewhere in a forum ...
and I tried to test it in two simple tests.

My test sources on this temporary Github Gist:
https://gist.github.com/Faq400Git/4a55c3ef8a2b098a9bdd9e7aec94130e

TEST 1:
trying some simple test running simple QSH command (cp, ls, echo) and
getting STDOUT back. So everything works properly.

TEST 2:
I try to test a command that allows me to exchange messages between STDIN
and STDOUT: the command "cat" ... which, if launched alone, leaves an
active session that repeats, like a parrot, everything I write in the STDIN.
It does not work! I'm not able to play ping-pong writing something in STDIN
and reading the same text from STDOUT back. My RPG program freezes when it
tries to read from STDOUT
....
p_buffer = fgets( %addr(buffer): %size(buffer): four);
...

I got this problem because I try to leave child-STDIN open to send messages
from the parent (RPG) program
...
callp close(pipeout(INPUT_END));
callp close(pipeerr(INPUT_END));
// DPR do not close pipein
//callp close(pipein(INPUT_END));
//callp close(pipein(OUTPUT_END));
..

Has anyone tried to do something similar?

I tried also a different way (Thomas Raddats' way) with the same result (
http://www.tools400.de/English/Freeware/Snippets/snippets.html)

Thanks
Roberto









As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.