users@servlet-spec.java.net

[servlet-spec users] [jsr340-experts] Re: NIO writes and flush()

From: Rémy Maucherat <rmaucher_at_redhat.com>
Date: Tue, 15 Jan 2013 12:01:07 +0100

On 01/15/2013 11:53 AM, Mark Thomas wrote:
> So if isReady() has just
> returned false, then it would mean you should wait for the write
> listener call to do the flush().
> But what would be the point of calling flush() at that point?
I think some data will still be in the buffer in the Servlet layer. I
haven't read that it would be automatically flushed before calling the
write listener (it probably shouldn't be, it would likely make IO less
efficient by causing extra writes).
>
> And if you don't wait should an ISE be thrown if flush() is called?
Yes, doing the same thing as for a write could be logical.

Rémy