users@grizzly.java.net

Re: Closing a single connection while using keep alive

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Tue, 09 Jun 2015 18:21:33 +0200

Thank you, Ana.

I'll fix it asap.

WBR,
Alexey.

On 08.06.15 14:58, Ana Laura Felisatti wrote:
> Done, https://java.net/jira/browse/GRIZZLY-1780
>
> Thanks!
>
> On Sun, Jun 7, 2015 at 8:33 AM, Oleksiy Stashok
> <oleksiy.stashok_at_oracle.com <mailto:oleksiy.stashok_at_oracle.com>> wrote:
>
> Hi Ana,
>
> httpResponsePacket.getProcessingState().setKeepAlive(false);
> definitely will work, but anyway it's a bug, because "Connection:
> close" should work as well.
> Can you pls. file an issue?
>
> Thanks.
>
> WBR,
> Alexey.
>
>
> On 05.06.15 22:12, Ana Laura Felisatti wrote:
>
> Hi, there.
>
> I was wondering what is the proper or best way to close a
> connection while maintaining a general keep alive policy.
>
> We are creating a HttpServerFilter with a KeepAlive, so that
> connections are not closed unless they timeout. However, the
> response we generate could potentially include a "Connection:
> close" header, in which case we want the connection to close
> when the response is sent.
>
> I tried explicitly closing the connection using the
> FilterChainContext but I'm sure that will cause complications.
> I then tried this with the HttpResponsePacket we generate and
> that makes it to the prepareResponse method of HttpServerFilter:
>
> httpResponsePacket.getProcessingState().setKeepAlive(false);
>
> Is that the proper way?
>
> Thanks,
>
> --
> Ana Felisatti
>
>
>
>
>
> --
> A. Felisatti