dev@grizzly.java.net

Re: controller question

From: gustav trede <gustav.trede_at_gmail.com>
Date: Mon, 19 Jan 2009 11:20:39 +0100

2009/1/19 Oleksiy Stashok <Oleksiy.Stashok_at_sun.com>

> Hi Gustav,
>
> why does controller call
>> selectorHandler.getSelectionKeyHandler().cancel(key); for invalid keys ?.
>> the cancel method first line is to check for invalid and if so return;
>>
> Agree, logic looks strange. Though it's good to have one place
> (SelectionKeyHandler.cancel()), where one can place a logic to handle
> SelectionKey invalidation, closing.
> What do you think?
>
yes exectly !
thats what i did in the cometselector . that allows for threadsafe handling
of the event logic related to it.
(guarantied only 1 event per cancel etc.)

there are further unclear things in the handling of selectionkeys.
i dont know if its me who dont understand , or if its truly is that wrong.

the first large chunk of code is on several places setting the
deletagetoworkerthread status flag, that is never used for that situation
due to a continue;
do you know why ?



>
> Thanks.
>
> WBR,
> Alexey.
>
>
>>
>> i have seen the same thing done in cometselector.
>>
>> what is the intended logic ?
>>
>> --
>> your servant
>> gustav trede
>>
>> coding is art - not only something that bring food on the table,
>> everybody should be able to feel proud about their code,
>> that they have performed their best considering the given conditions.
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>
>


-- 
your servant
 gustav trede
coding is art - not only something that  bring food on the table,
everybody should be able to feel proud about their code,
that they have performed their best considering the given conditions.