Le 1/8/13 4:06 PM, Chad Beaulac a écrit :
> Understood on change in state between writable event firing and socket could 
> close by the time you goto write. In which case the read event would fire 
> next and result in zero bytes read signaling the socket is closed. 
>
> Your statement below is exactly what I have dealt with on many systems. 
> Resulting in TCP buffer overflow and RAM bloat/leak. 
> "One possible case would be if the underlying OS were to accept anything
> you try to write into the socket..."

In my understanding, you can mitigate such pb by setting the
SO_SNDBUF,accordingly to your client capacity. At some point, if your
client is slow, you perfectly can ends with your server being swamped
with data waiting to be sent, but I don't see hav using a queue can help
here : as soon as the socket will refuse to accept anymore data than the
buffer it uses to store the data, you are safe.

In other words, your application should take care of such scenario, or,
better for MINA to provide the tools to inform the application when the
sending queue is getting too large...

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 

Reply via email to