jsr340-experts@servlet-spec.java.net

[jsr340-experts] Re: Candidate for Servlet 3.1 Early draft review

From: Remy Maucherat <rmaucher_at_redhat.com>
Date: Tue, 06 Mar 2012 23:49:23 +0100

On Tue, 2012-03-06 at 11:35 -0800, Rajiv Mordani wrote:
> > My feedback was exclusively on the upgrade part. I already sent you some
> > feedback on the rest (but didn't get an answer).
>
> I replied to your email didn't I?

Not the next reply.

> > If a connection is idle for a while, it should trigger a timeout.
> > Although keeping a socket alive is not that expensive, it is still a
> > restricted resource in the OS. It is similar to the timeout support in
> > Servlet 3.0 async.
>
> So a onTimeout callback on the ReadListener and WriteListener would
> work? Something
> along the lines of
> ReadListener
> onTimeout(ServletRequest req)
>
> WriteListener
> onTimeout(ServletResponse res)

Read/WriteListener are for the Servlet 3.1 IO, which could use the
AsyncListener API maybe ?

> and change the addReadListener to setReadListener(ReadListener listener,
> long timeout)
>
> and change addWriteListener to setWriteListener(WriteListener listener,
> long timeout)
>
> where if timeout is 0 then it would never timeout.
>
> Does that make sense?

Maybe.

So ProtocolHandler would also have a timeout method ? (since it doesn't
use Read/WriteListener)
Along with a WebConnection."suspend" and ProtocolHandler."resume" to
deal with the thread management during some possible processing ? (but
it may not be mandatory)

-- 
Remy Maucherat <rmaucher_at_redhat.com>
Red Hat Inc