You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2010/10/06 00:49:22 UTC

The right place to create the decoder ...

  Hi,

we have a over-complicated system to initialize the decoder and all what 
we need for the message processing : we use factories, we pull data 
structure related to the server while we create the decoder and the 
encoder, when we receive the first message to decode.

This is just plain wrong. Mina has the exact event to use when the 
session is created : the sessionCreated() event, which goes up to the 
handler. This is the right place to do whatever we have to do to 
initialize the encoder the decoder, and put every information we need to 
correctly process an incoming message.

I don't know why I didn't realized that before, because it's absolutely 
obvious. Maybe because it was just working more or less, and I never had 
the time not the will to rethink this part.

Or may be I'm just tired and I need to get some sleep...

So here is what I gonna do : I will sleep on this idea, and let see what 
it brings, or maybe you guys have a better insight about this problem :)

nn !

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com