Protobuf data using Netty

auron jinslee at gmail.com
Thu Nov 18 16:11:18 EST 2010


Hi all - 

I'm a netty newbie but I have to say it's such an awesome framework! Within
a couple weeks I was able to get a basic client/server app running over
TCP/IP and using protobuf to communicate. I can't believe how easy it was
despite the fact that I really have zero programming experience with
client/server apps. 

I just had one question regarding using Netty + protobuf. I followed the
example and I have a Server and Client talking to each other. However, I
seem to run into this problem every once in awhile:

I have a simple proto class that just contains repeatable int32s. I build an
array of size 1024 with a value of 1 in each element. When I send this over,
99.9% of the time it works fine. But every once in awhile, the data that
gets received is not always a bunch of 1s. Sometimes the value 256 shows up. 

I remember reading in another example that you have to buffer the incoming
messages (using a FrameDecoder? I think) because the data might not be
completely sent over. I am using ProtobufVarint32FrameDecoder but perhaps I
am not using it correctly. Anyway, I was just wondering if this type of
error is possible. I can post my code if it will help. 

Thank you very much and have a great day!
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Protobuf-data-using-Netty-tp5753309p5753309.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list