users@grizzly.java.net

Re: One or two Controllers

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Tue, 23 Oct 2007 10:23:03 -0400

Hi,

Radim Kolar SF.NET wrote:
> I am writing recursive DNS server.
>
> It has 2 parts doing network-related work.
> one part reading requests from clients on port 53
>
> second part is dealing with remote servers (sending requests to them and
> waiting for replies)
>
> i will nead 2 different protocol chains. one for parties queries and second
> for parsing replies. Need i create 2 controller objects? (i think yes)

Yes in that case two Controller will be needed. An alternative is to
find a way inside your ProtocolFilter to determine the state of the
transation: parsing or reading. But it might makes the code difficult to
read so I would say two Controller is your solution. But you can always
share the same Thread Pool (Pipeline) between the two Controller to
avoid havng too many threads.

Hope that help.

-- Jeanfrancois


>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>