users@grizzly.java.net

Re: Read Timeout and Port unifcation

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Thu, 2 Jun 2016 15:54:20 -0700

Hi,

On 6/2/16 5:18 AM, vetti07 wrote:
> Hi,
> I'm using Grizzly Port unification for using same port for both http and
> a tcp service. I have created the http server using
> GrizzlyHttpServerFactory.createHttpServer(...). then registering an add on
> for TCP Protocol finder/filters. My TCP service has Two filters.
>
> In one of my filter in handleRead() method I set the timeout as 10 seconds
> using ctx.getConnection().setReadTimeout(10, TimeUnit.SECONDS) and doing
> cxt.read() in a loop (cxt is the FilterChainContext). The idea was to keep
> reading data from client till it closes the connection. I'm facing two
> issues with this
>
> 1. cxt.read() is not timing out(Even after 30 mins )
> 2. In filter I have overridden handleClose() method which is never getting
> invoked. I tried using CloseListener which is working fine. Not sure why
> handleClose method on the filters are not invoked.

In 2.3.x we keep PUFilter in the Connection filter chain forever, so it
makes a routing (pu) decision for every packet. So once connection is
closed - it can't figure out where to route this error, because there is
no packet payload to know where to route the error. So handleClose won't
work unfortunately.
However ctx.read() should work with timeout and it sounds like a bug.
Could you pls. share the testcase, so we can reproduce the problem.

Thank you.

WBR,
Alexey.
>
>
> Thanks
> ashok
>
>
>
>
>
> --
> View this message in context: http://grizzly.1045725.n5.nabble.com/Read-Timeout-and-Port-unifcation-tp5711028.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.