Creating a Socket to System.in ?

Discussion in 'Java' started by FET, Feb 27, 2004.

  1. FET

    FET Guest

    Hello everyone,
    I am in a slight soup here.
    For people who are familiar with linux, I am trying to invoke a java
    app using xinetd. I have gotten the app to run, but it doesn't perform
    IO. Xinetd passes the socket descriptor as the standard input i.e
    System.in. Therefore, I can simply do BufferedInputStream(System.in)
    and then read() from it.
    But the problem is, how do I write results back to this stream ?
    Please advise.

    Thanks in advance.
    Regards.
     
    FET, Feb 27, 2004
    #1
    1. Advertising

  2. On 27 Feb 2004 03:29:12 -0800, FET wrote:
    > For people who are familiar with linux, I am trying to invoke a java
    > app using xinetd. I have gotten the app to run, but it doesn't
    > perform IO. Xinetd passes the socket descriptor as the standard
    > input i.e System.in. Therefore, I can simply do
    > BufferedInputStream(System.in) and then read() from it. But the
    > problem is, how do I write results back to this stream ?


    Write to stdout (System.out).

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Feb 27, 2004
    #2
    1. Advertising

  3. "FET" <> schrieb im Newsbeitrag
    news:...
    > Hello everyone,
    > I am in a slight soup here.
    > For people who are familiar with linux, I am trying to invoke a java
    > app using xinetd. I have gotten the app to run, but it doesn't perform
    > IO. Xinetd passes the socket descriptor as the standard input i.e
    > System.in. Therefore, I can simply do BufferedInputStream(System.in)
    > and then read() from it.
    > But the problem is, how do I write results back to this stream ?
    > Please advise.


    I haven't tried it, just ideas:
    If xinetd writes to stdin of your application it propably also reads from
    stdout?
    If this doesn't work you could try to use the redirect option of xinetd to
    lead to another (local host and) port where your java app resides.
    Albert
    >
    > Thanks in advance.
    > Regards.
     
    Albert Deinbeck, Feb 27, 2004
    #3
  4. FET

    nos Guest

    "FET" <> wrote in message
    news:...
    > Hello everyone,
    > I am in a slight soup here.
    > For people who are familiar with linux, I am trying to invoke a java
    > app using xinetd. I have gotten the app to run, but it doesn't perform
    > IO. Xinetd passes the socket descriptor as the standard input i.e
    > System.in. Therefore, I can simply do BufferedInputStream(System.in)
    > and then read() from it.
    > But the problem is, how do I write results back to this stream ?
    > Please advise.
    >
    > Thanks in advance.
    > Regards.


    you don't mean to write to the input do you?
    if you do, then do you want your program read what you wrote?
     
    nos, Feb 27, 2004
    #4
    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. Laszlo Nagy
    Replies:
    1
    Views:
    4,922
    Mark Wooding
    Jan 27, 2009
  2. Jean-Paul Calderone
    Replies:
    0
    Views:
    992
    Jean-Paul Calderone
    Jan 27, 2009
  3. Laszlo Nagy
    Replies:
    0
    Views:
    565
    Laszlo Nagy
    Feb 1, 2009
  4. Steve Holden
    Replies:
    0
    Views:
    683
    Steve Holden
    Feb 1, 2009
  5. Steve Holden
    Replies:
    1
    Views:
    730
Loading...

Share This Page