ProtocolCodecFilter will call TestCodecFactory.getDecoder() to get a decoder for each new session. So if your TestCodecFactory returns a new decoder whenever this method is called you will end up with one decoder per session. If your Decoder implementation is stateless you could return the same instance all the time to avoid this.
/Niklas Michael Bauroth wrote: > Hi, > > here is a code snippet: > > mAcceptor = new SocketAcceptor(); > mAcceptorConfig = new SocketAcceptorConfig(); > mAcceptorConfig.setDisconnectOnUnbind(true); > mAcceptorConfig.setReuseAddress( true ); > > DefaultIoFilterChainBuilder tChain = mAcceptorConfig.getFilterChain(); > TestCodecFactory tFactory = new TestCodecFactory(); > ProtocolCodecFilter tFilter = new ProtocolCodecFilter( tFactory ); > pChain.addLast( "testcodec", tFilter ); > > Regards > Michael > > > [EMAIL PROTECTED] wrote: > >> >> In general, no. How are you adding it to the chain of the >> SocketAcceptorConfig? >> >> Robert >> >> >> *Michael Bauroth <[EMAIL PROTECTED]>* >> >> 18/04/2006 22:18 >> Please respond to mina-dev >> >> To: [email protected] >> cc: Subject: One decoder instance for >> each session? >> >> >> >> >> Hi, >> >> is it right, that a decoder, which I've added to the chain of the >> SocketAcceptorConfig, will be instantiated separately fro each session? >> In other words - when I have 2000 opened IoSessions, are there also 2000 >> similar decoder instances? It seems so (have seen it in my log), but I'm >> not sure, if it is right ... >> >> Regards >> Michael >> >> >> >> This communication is for informational purposes only. It is not intended >> as an offer or solicitation for the purchase or sale of any financial >> instrument or as an official confirmation of any transaction. All >> market prices, >> data and other information are not warranted as to completeness or >> accuracy and >> are subject to change without notice. Any comments or statements made >> herein >> do not necessarily reflect those of JPMorgan Chase & Co., its >> subsidiaries >> and affiliates. > > >
