users@grizzly.java.net

Re: Protocol type inside ProtocolParser

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 28 Sep 2009 15:44:41 -0400

Salut,

Tigran Mkrtchyan wrote:
>
> Hi,
>
> short question: how can I distinguish between TCP and UDP inside
> protocolParser?

Interesting question. I think the easiest way is to:

(1) override public boolean execute(Context ctx) from
ParserProtocolFilter and locally store the result of ctx.getProtocol()
as WorkerThread.getAttachement().setAttribute(...) or a ThreadLocal.
(2) Inside the newProtocolParser(), retrieve that value.

Does that help?

A+
-- Jeanfrancois
>
> Thanks,
> Tigran.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>