dev@grizzly.java.net

Re: (Trivial) RoundRobinSelectorHandler's roundRobinCounter

From: rama <rama.rama_at_tiscali.it>
Date: Wed, 13 May 2009 09:39:07 +0200

isn't better to use something like?

private ReadController nextController() {
        return rrControllers[((roundRobinCounter++) & 0xFFFFFFFF)%
rrControllers.length];
}

--------

> RoundRobinSelectorHandler#nextController()
> ---
> private ReadController nextController() {
> int index = roundRobinCounter++ % rrControllers.length;
> if( roundRobinCounter < 0 )
> roundRobinCounter = 0;
> return rrControllers[index];
> }
> ---
>
>
> Thanks.
>
> --
> Bongjae Chang