|
Quick Lists
|
|
Bug ID:
|
4091423
|
|
Votes
|
0
|
|
Synopsis
|
java.io: Support non-blocking I/O
|
|
Category
|
java:classes_io
|
|
Reported Against
|
1.1
, 1.1.2
|
|
Release Fixed
|
|
|
State
|
11-Closed, duplicate of 4075058,
request for enhancement
|
|
Priority:
|
5-Very Low
|
|
Related Bugs
|
4075058
,
4074655
|
|
Submit Date
|
07-NOV-1997
|
|
Description
|
[not] so much a bug report as an RFE for a cleaner way of
handling blocking io. It looks like right now I need to tie
up a separate thread for each socket since I have to keep
read()ing the stream constantly, or even uglier, set an SoTimeout
and loop through all the streams with read() commands.
A better way would be to have add/removeInputListener()
methods in InputStream so a listener could be notified
whenever the stream got more data or EOF. IMHO this would
be great for handling input from any source that blocks.
Since jdk1.2b1 is due out soon, I know this RFE is late -- which
is why I submitted it two months ago! ;) -- but nonetheless I
hope you'll consider it or pass it along as you think appropriate.
I think an InputListener would be a very Good Thing.
Charles
--
(Review ID: 13782)
======================================================================
|
|
Work Around
|
class Groan extends Thread {
public void run ( ) {
try {
InputStream is = socket.getInputStream ( );
while ( true ) ...
} catch ( Exception e ) {
}
}
}
======================================================================
|
|
Evaluation
|
N/A
|
|
Comments
|
Submitted On 15-MAR-1999
adam@organic.com
This is really a duplicate of 4094858.
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|
|
|
 |