Structured message reading problem in Netty.

Frederic Bregier fredbregier at free.fr
Fri May 1 01:41:43 EDT 2009


Hi Manish,

I don't know if it is an accident or not, but posting twice the same answer
will not give you an answer faster... ;-)

>From your code, I see the following:
- Your decoder is unique for each channel, so ok.
  @ChannelPipelineCoverage("one") is appropriate.

- You business handler (this.handler) is shared across all connections.
  If this is intend then it is ok. The meaning is that every private
variable
  of this handler will be shared across all channels. But if you do not have
  any shared variables, then it is perfectly ok.
  Therefore @ChannelPipelineCoverage("all") should be appropriate for this
handler
  only. Note again that the @ChannelPipelineCoverage(xxx) is just a tips for
  the reader of the code right now, nothing is done by Netty with this for
the moment.

- The info you get (DISCONNECTED and UNBOUND) seem to say that your handler
  (this.handler) close the connection after the first message.
  Maybe you cannot have a second message because your handler (this.handler)
  is just behaving like this ?

- Your LoggingAgentMessageDecoder seems ok to me with ReplayingDecoder.
  If you wanted to use FrameDecoder, you will have to check the available
bytes
  which is done for you by the ReplayingDecoder.

HTH,
Frederic


-----
Hardware/Software Architect
-- 
View this message in context: http://n2.nabble.com/Structured-message-reading-problem-in-Netty.-tp2682454p2751867.html
Sent from the Netty User Group mailing list archive at Nabble.com.




More information about the netty-users mailing list