jsr340-experts@servlet-spec.java.net

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

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Thu, 08 Mar 2012 12:57:23 -0800

On 3/6/12 2:49 PM, Remy Maucherat wrote:
> 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)
>
One can put onInputTime and onInputClose in ProtocolHandler as suggested
in previous emails.

Shing Wai Chan