bidirectional pipe & inetd

Discussion in 'Perl Misc' started by papahuhn, May 30, 2007.

  1. papahuhn

    papahuhn Guest

    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
     
    papahuhn, May 30, 2007
    #1
    1. Advertising

  2. papahuhn

    Guest

    papahuhn <> wrote:
    > 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

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
     
    , May 30, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sakagami Hiroki

    inetd like server socket supervisor in Java

    Sakagami Hiroki, Jun 7, 2006, in forum: Java
    Replies:
    2
    Views:
    2,106
    Martin Gregorie
    Jun 7, 2006
  2. Jan

    inetd script in python?

    Jan, Feb 27, 2004, in forum: Python
    Replies:
    4
    Views:
    2,518
    Donn Cave
    Mar 1, 2004
  3. J Rice
    Replies:
    6
    Views:
    718
    J Rice
    Mar 11, 2006
  4. Manfred Balik
    Replies:
    12
    Views:
    6,605
    Marc Guardiani
    Sep 10, 2006
  5. Gernot Frisch
    Replies:
    7
    Views:
    1,523
    Jorgen Grahn
    Dec 18, 2010
Loading...

Share This Page