Jeanfrancois Arcand wrote:
> Hi Alexey,
>
> Oleksiy Stashok wrote:
>> Hi,
>>
>> I'd like to ask, what is the safe way to stop controller?
>> As if it's started in some thread and I try to stop it from different
>> one calling controller.stop() - then controller's working thread is
>> starting to throw exceptions [1]...
>> Am I doing something wrong? Or it's a bug?
> I don't think you are doing something wrong....I don't know if there
> is a good way of stopping a controller. In Grizzly 1.0, I was first
> cycling over all the SelectionKey, cancelling them. I suspect we need
> to do something like that as well to avoid Selector.select()...Do you
> have time to take a look?
Yes, I will look there.
I saw key canceling cycle, but seems it also has an issue, as it's
possible for key's channel to be *Server*SocketChannel, which leads to
ClassCastException.
WBR,
Alexey.
>
> Thanks
>
> -- Jeanfrancois
>
>
>
>
>>
>> Thanks.
>>
>> WBR,
>> Alexey.
>>
>> [1] java.nio.channels.ClosedSelectorException
>> at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:66)
>> at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
>> at
>> com.sun.grizzly.TCPSelectorHandler.select(TCPSelectorHandler.java:221)
>> at com.sun.grizzly.Controller.doSelect(Controller.java:186)
>> at com.sun.grizzly.Controller.start(Controller.java:364)
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>