Message lost

"이희승 (Trustin Lee)" trustin at gmail.com
Tue Jun 29 05:25:53 EDT 2010


Hi Bertrand,

Aha.  You manipulate the pipeline dynamically.  Removing an encoder
shouldn't be a problem, but removing a decoder is another problem
because a decoder will store the received data in its internal buffer.
Therefore, you have to retrieve the content of the unhandled data in the
decoder's internal buffer to make sure no data is lost.

Since FrameDecoder does not expose its internal buffer directly, you
have to access it inside the decode() method:

    http://is.gd/d8ErE

HTH,
Trustin

On 06/29/2010 06:21 AM, bgoetzmann wrote:
> 
> Finally, I think that I understand my mistake: I thought in terms of messages
> and not in terms of byte packets.
> Implicitely I supposed that for each write statement in the client part, I
> received one message in the server part, but it's not mandatory.
> 
> I've resolved my specific problem that was to send a file from a client to a
> server, and for which I needed to send first some information about the file
> to transfer.
> So my first idea was to send an object using an encoded handler, removed
> this handler, and used a chunked writer handler, but I realize that it
> conducted to mixed data on the server part.
> 
> Now I use only one handler for each part of the application, and the client
> part write bytes containing informations about the file to transfer (name
> and length), a 0 value, followed by the content data file; and on the server
> side, I am able to fetch the correct data, knowing that it is possible that
> the first message received can not be only the information file.
> 
> Is there a better way to do a such thing, playing with the dynamic handlers
> in a pipeline like I tried to do? Let me to know.
> 
> Soon, I will share my application JavaFX/Netty application. And thanks Netty
> it is really very fast!
> 
> Cheers,
> 
> 
> Bertrand,
> http://www.odelia-technologies.com
> 
> 
> 
> 

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 293 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100629/cbe6da51/attachment.bin 


More information about the netty-users mailing list