Message to Netty Server sometimes gets lost

NettyMW a2642372 at bofthew.com
Sun Jul 11 08:38:30 EDT 2010


I have implemented a Java Server with netty which communicates with a Java
TCP Socket Client. 
The Server sends some information to a Java TCP Socket Client and reads
StatusCodes from this Client. After sending the statuscode with:

outputStream.write(satuscode);
outputStream.flush();

The Client disconnects. 

The Problem is, sometimes Statuscodes get lost - the Statuscode never enters
the StatusCodeDecoder of the Server. When the Client doesn't perform the
disconnection but the server after receiving a statuscode, everything works
fine. 
1. Question: is this normal behaviour? Or do i have a synchronisation
Problem or something?

The course of actions:
- Server starts. A XHandler (not sharable) is added to the server's pipeline
(pipeline.addLast). Question 2.: This means for every connection a new
handler is added to the pipeline?
- Java Client connects and sends some Binary Data.
- On channelOpen the XHandler adds a DecoderX to the pipeline
(pipeline.addFirst)
- XDecoder accepts the Data from the Client and depending on the received
data, a YDecoder is added after XDecoder. Afterwards XDecoder is removed
from the pipeline and the Data is handed over to the YDecoder
- YDecoder accepts further Data and returns a JavaObject
- On messageReceived the XHandler gets the JavaObject. Then XHandler adds a
new DecoderZ to the pipeline (atFirst) and sends some Data to the Client
- The Client reads the Data and sends a StatusCode to the Server then the
client disconnects
- The ZDecoder (StatusCodeDecoder) should accept the StatusCode but sometime
no statuscode is received?

Further Questions: 
3. when a new Connection is opened the old Decoder are removed from the
Pipeline? Or are there more and more XHandlers and Decoders in the
Pipeline??
4. Do i have to synchronize the decode Messages of the Decoders or something
else?


Best Regards, Michael  

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


More information about the netty-users mailing list