users@grizzly.java.net

Re: Grizzly 2.0 M3 infinite loop using multi-binding

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 08 Jun 2009 12:23:51 -0400

Salut,

JopieC wrote:
> When I use multi-binding the server loops continuesly when I send a shutdown
> request to the command port.
>
> My idea was to create a Transport with different ServerConnection's, each
> with a custom Processor. Like this:
>
> for (X x: iterableSet)
> {
> String sAddress = x.getAddress();
> int iPort = x.getPort();
> Processor processor = x.getProcessor();
>
> Connection serverConnection = transport.bind(sAddress, iPort);
> serverConnection.setProcessor(processor);
> }
>
> When I sent a shutdown request (to one of the ServerConnections) an infinite
> loop started. So I looked into the code and saw this in
> TCPNIOServerConnection::registerAcceptedChannel:
>
> Processor processor = transport.getProcessor();
>
> When I replaced this with
>
> Processor processor = this.getProcessor();
>
> it worked fine. This also makes sense (to me at last ;-).
>
> Is this correct (the fix), or should I use the framework in a different way?
> In any case I think the infinite loop should be prevented.

Agree. Can you file an issue here:

https://grizzly.dev.java.net/issues/post_bug.cgi

I will work on it as soon as I finish to read all the email here :-)

Thanks!

-- Jeanfrancois



>