bidirectional pipe & inetd

P

papahuhn

Hello,
I want to create a wrapper for an application that is normally run by
xinetd.
The information flow should be as following: xinetd <-> wrapper <-> app.

So I have to execute the app within the wrapper and communicate with it
using a bidirectional pipe. Unfortunately there is a problem with the
input-buffering of the open2() handles as mentioned by perldoc perlipc:
The problem with this is that Unix buffering is really going to ruin
your day. Even though your "Writer" file handle is auto-flushed, and
the process on the other end will get your data in a timely manner,
you can't usually do anything to force it to give it back to you in a
similarly quick fashion. In this case, we could, because we gave
cat a -u flag to make it unbuffered. But very few Unix commands are
designed to operate over pipes, so this seldom works unless you
yourself wrote the program on the other end of the double-ended pipe.


My first attempts to use Expect did not solve the problem.
Has anyone concrete experience with this matter?

Thanks
 
X

xhoster

papahuhn said:
Hello,
I want to create a wrapper for an application that is normally run by
xinetd.
The information flow should be as following: xinetd <-> wrapper <-> app.

So I have to execute the app within the wrapper and communicate with it
using a bidirectional pipe. Unfortunately there is a problem with the
input-buffering of the open2() handles as mentioned by perldoc perlipc:

If the application is already designed to run properly through xinetd, I
would expect that it would already Do The Right Thing with respect to
buffer flushing. Can you give more details about what you expect versus
what you see happen? How much control do you have over the application?


Xho
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top