Le Sun, 29 Mar 2009 12:14:05 +0200, Emmanuel Lecharny <[email protected]> a écrit :
> Hi, > > the codec factory expose two methods : > public ProtocolEncoder getEncoder( IoSession session ) > public ProtocolDecoder getDecoder( IoSession session ) > > Usually, when designing a new codec, those methods returns a new > instance of the decoder/encoder for each sessions, as these instances > are stored into the user's session. In many cases (ie, when the > encoding/decoding is stateless), this is useless. We should instead > create unique instances of those encoder/decoder, and store the > instance into the session. Even if the codec is stateful, the current > codec state should not be handled within the codec, but in a separate > context object. > > I'm not saying that the current implementation is wrong, but I think > we should stress out this in the codec documentation, in order to let > the protocol developers to know about it. > I thought it was clear , but you are right, that need more documentation (stateless vs statefull codec) Julien
signature.asc
Description: PGP signature
