Stuart Ballard <[EMAIL PROTECTED]> writes: > On 9/9/05, Nic Ferrier <[EMAIL PROTECTED]> wrote: >> Personally, I think Chris should add a lazy (streaming) interface on >> top. But there is a thread cost. > > Is there no way to only call select() when calls are made to the API, > in the thread that makes the call? getInputStream() could return a > stream that calls select() (directly or indirectly) in its available() > and read() methods, getHeader() (if we don't want to get all the > headers up front) could call select() if the header in question is not > yet known, etc.
select blocks or times out after a period. So I guess you could do it the way you suggest - with a very small timeout. > I'm not really familiar with the nio API (as you can probably tell) > but it seems like this kind of thing should be possible. Wasn't the > whole point of nio to *avoid* the need for "thread-per-connection" > programming? NIO allows you to multiplex many connections with a single thread. Nic _______________________________________________ Classpath mailing list [email protected] http://lists.gnu.org/mailman/listinfo/classpath

