Protobuf and Pipeline questions
"이희승 (Trustin Lee)"
trustin at gmail.com
Wed Jul 7 03:50:49 EDT 2010
Hi Christian,
I would wrap the protobuf messages with an envelope protocol. For example:
<TYPE> <LENGTH> <PROTOBUFDATA>
You could determine which protobuf type the message is from the <TYPE>
field. It means you need to write a decoder / encoder by yourself
though. It shouldn't be difficult. Please start from the Factorial
example.
HTH,
Trustin
On 07/01/2010 07:06 PM, VuuRWerK wrote:
>
> Hi list,
>
> is there any way to set more then one protobufEncode/-Decoder?
>
> Let me explain my problem: I have a command which will be send from the
> client to the server. The server get the command and do some work according
> to the command. Now the response ("answer") of the server could be:
> "nothing", "simple" or "complex". "Nothing" means, the server get the
> command and the clients doesn't wait for a response from the server, in turn
> the server won't give a response. "Simple" means, the answer is maybe just a
> status message, a return code or something simple. The message won't exceed
> 256 byte. And last but not least the "complex" response will be a bunch of
> data (in future the data will be compressed) which could be up to several
> MB.
>
> My question is now: What can I do that the client can receive at least 2
> different responses from the server? Both are "encoded" with Protobuf. And
> in turn, what I need to do that the server can send at least 2 different
> responses? Also both are "encoded" with Protobuf.
> To set 2 different protobufEncoder/-Decoder is not possible.
>
> Thanks in advance and best regards
> Christian
--
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/20100707/b844a887/attachment.bin
More information about the netty-users
mailing list