Message to Netty Server sometimes gets lost

NettyMW a2642372 at bofthew.com
Sun Aug 29 09:29:04 EDT 2010


Hmm, no that doesn't help me... When i use buffer.readBytes(
buffer.readableBytes()); in the XDecoder (ReplayingDecoder) to forward the
current read buffer to the YDecoder that doesn't work (there are 2147483645
readable Bytes). Only super.actualReadableBytes(); returns the appropriate
number of bytes so i have to use this statement.

The problem is that the statuscode sometimes doesn't reach the
StatusDecoder. Here is the Pipeline:

1. Pipeline:   
XDecoder
idlehandler
ChannelHandler


2: YDecoder is added and XDecoder is removed. YDecoder received some Data
and in the messageReceived of the ChannelHandler the ZDecoder is added.
Pipeline:  
YDecoder
idlehandler
ChannelHandler



messageReceived(...) of ChannelHandler:
e.getChannel().getPipeline().addFirst("ZDecoder", new ZDecoder());
ChannelBuffer buffer = ...;
e.getChannel().write(buffer); // Here i write some Data to the Client. The
Client reads the Data and then writes some Data (StatusCode) back on the
same connection. This Data schould be consumed by ZDecoder. But sometimes
the decode method of ZDecoder is never called...

Pipeline at this point:  
ZDecoder
YDecoder
idlehandler
ChannelHandler


As i mentioned in a previous post. When the Server closes the connection and
not the client everything works or when the client doesn't immedialty close
the connection after sending the statuscode (e.g. there's a sleep(500)) it
also works. So there is a solution but i do not understand the behavior i
explained above.

Michael


-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Message-to-Netty-Server-sometimes-gets-lost-tp5279786p5474944.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list