implementation of blocking input

ljohnston johnstlr at yahoo.co.uk
Tue Oct 18 12:48:40 EDT 2011


Hi Bill

Are you intending to read from your InputStream from a thread other than
Netty's IO Worker? If so Norman's suggestion might work.

Could you have an InputStream implementation that managed an internal
buffer. In messageReceived you pass the ChannelBuffer into your InputStream.
If the InputStream buffer has reached a a specified max size you set
channel.setReadable(false) to prevent Netty reading anymore data.

As your reading thread consumes the data you can call
channel.setReadable(true) to allow Netty to start reading again.

Apologies if I'm completely off the mark.

Cheers
Lee


bburke wrote:
> 
> Because I want to write a blocking java.io.InputStream around the 
> channel instead of buffering the entire message body in memory.
> 


--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/implementation-of-blocking-input-tp6902613p6905419.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list