On 4/4/06, Vinod Panicker <[EMAIL PROTECTED]> wrote: > > I think there should be a param that allows the read buffer size to be > configured. An OutOfMemoryError is ghastly! MINA shouldnt read() > from the session if the buffer is already full. This will cause the > kernel buffer to get filled up, causing the flow control mechanism to > kick in. This will cause the sender to send less data, just enough > that the receiver can consume.
You're right, too. We need to modify the core code in this case to keep track of the virtual read buffer size, which is actually an acumulated byte count. The count value will increase when data is read from a channel and the buffer is conveyed into the filter chain and then decrease when the buffer is released or passed to messageReceived handler. But I don't have any clue on writes. Because writes are asynchronous, We cannot block simply. Any idea? Thanks, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6
