Creating a Socket to System.in ?

F

FET

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.
 
G

Gordon Beaton

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
 
A

Albert Deinbeck

FET said:
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
 
N

nos

FET said:
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?
 

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top