Thu, 1 Apr 2010 14:11:01 +0200 -n
Kúti Zsolt <[email protected]> írta:

...
> The problem:
> _After_ thousands of call to my component (connector.connect()...) 
This statement needs correction: it can happen much earlier, too.
 
> Handler seemingly gets prematurely notified on session opening
> event compared to ConnectFuture listener.
Looking at IoListenerSupport.fireSessionCreated() I see that 
filterChain.fireSessionOpened() is called first (in a separate
thread). So it is undeterministic who gets first, session or listener:
although in my case mostly the former.

I am not in the position as to judging if calling listeners first would
be better in general.

But how can this issue be solved then? I cant see another design at this
moment. 
- I can not wait for connections, so listener is needed. 
- No session guaranteed to be available in ConnectFuture
  immiediately after connect to put my attribute into.
- Can not use different connector instances to store my attribute
  within it (or mapping to it). I tried this, but some thousand of
  instantiation resulted in resource exhaustion (probably atrributable
  to thread creation).

Thanks!
Zsolt

Reply via email to