Michael Bauroth wrote:
> Trustin Lee wrote:
>>
>> I think we can set a traffic mask in sessionCreated() because
>> sessionCreated() runs in the same thread with the I/O processor.
>>
>> Trustin
> 
> 
> So I assume, that if I had added a ThreadPoolFilter before,
> setTrafficMask musn't be used. Right?
> 
> Michael

No it can still be used. In fact, if you don't set a ThreadModel
yourself a ThreadPoolFilter will be used by default. So the example uses
a ThreadPoolFilter.

I think what Trustin meant was that sessionCreated() will always be
called by the same thread which handles the low level I/O.
ThreadPoolFilter will not delegate sessionCreated events to workers in
its pool. If reads are suspended in sessionCreated() it's guaranteed
that no data will be read from the socket until you resume reads again.

/Niklas

Reply via email to