Runtime.exec question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TiscaliNews

    Runtime.exec question

    Hi,

    I have a tool that listen on a tcp/ip port and when a message arrives, it is
    printed to stdout. This tool is started using Runtime.exec using a wrapper
    to catch the output of the tool. The wrapper is started and accessed from a
    jython script.

    Problem: The output from the tool (catched by the wrapper and displayed in
    jython) does not come always available at the time it is expected. The
    wrapper receives the output from the tool in a seperate thread and it looks
    that this thread does receive some messages far too late, as if it is
    blocked for some time.
    Any idea ?

    Regards
    Stellah


  • Kathy Benson

    #2
    Re: Runtime.exec question

    Stellah,
    It is possible that you are using buffered streams, which are not
    getting flushed. Manually flush all your output stream after you write
    something to them. This might have a little bit of performance overhead
    but you will get the messages right away.

    KB

    ------------------------------------------------------------------------
    This email is certified to be Spam free by Spam Marshall

    You don't pay to get spam, why pay to clean it?
    Visit http://www.spammarshall.com to create an account for free
    <http://www.spammarshal l.com>

    ------------------------------------------------------------------------
    TiscaliNews wrote:
    [color=blue]
    >Hi,
    >
    >I have a tool that listen on a tcp/ip port and when a message arrives, it is
    >printed to stdout. This tool is started using Runtime.exec using a wrapper
    >to catch the output of the tool. The wrapper is started and accessed from a
    >jython script.
    >
    >Problem: The output from the tool (catched by the wrapper and displayed in
    >jython) does not come always available at the time it is expected. The
    >wrapper receives the output from the tool in a seperate thread and it looks
    >that this thread does receive some messages far too late, as if it is
    >blocked for some time.
    >Any idea ?
    >
    >Regards
    >Stellah
    >
    >
    >
    >[/color]


    Comment

    Working...