H
HK
Hi,
is there any way to get a java.io.InputStream
go together with a java.nio.channels.Selector?
What I would like to do is similar to copying
System.in to System.out. Of course I can call
System.in.read() and System.out.write() in
sequence. The problem is: If no input arrives,
the thread will hang around in the read().
During that time, the ouput may be closed
by the other side without the thread
noticing.
Two threads, one for reading, one for
writing seems to be a bit of an overkill.
Harald.
is there any way to get a java.io.InputStream
go together with a java.nio.channels.Selector?
What I would like to do is similar to copying
System.in to System.out. Of course I can call
System.in.read() and System.out.write() in
sequence. The problem is: If no input arrives,
the thread will hang around in the read().
During that time, the ouput may be closed
by the other side without the thread
noticing.
Two threads, one for reading, one for
writing seems to be a bit of an overkill.
Harald.