Google protocol Buffer Codec
Jannick Bitsch
jannick at ovja.dk
Sat Jan 2 05:29:19 EST 2010
Hi
The easiest solution is to wrap all your messages in a 'union type' as
described in this protobuf tutorial:
http://code.google.com/intl/da-DK/apis/protocolbuffers/docs/techniques.html#union
Alternatively you will have to manually prepend some kind of command id to
identity the kind of protobuf message being sent, but unlikely to be worth
the trouble.
Regards
Jannick
<http://code.google.com/intl/da-DK/apis/protocolbuffers/docs/techniques.html#union>
2010/1/2 ritom <ritom at hotmail.com>
>
> Can somebody please help me understand the google protobuf support within
> Netty.
> In the LocalTimeServerPipelineFactory example we have
>
> p.addLast("protobufDecoder", new
> ProtobufDecoder(LocalTimeProtocol.Locations.getDefaultInstance()));
>
> That would mean we can now receive the Locations message in
> TimeServerHandler.
>
> public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
> Locations locations = (Locations) e.getMessage();
>
> How would I implement support for multiple incoming message types where you
> might be receiving different types of request from the client. Lets say you
> are receiving Logon first then BalanceRequest, TransferRequest and so on.
> Also server will reply with multiple Message Types depending on the
> request.
> Can somebody please please help.
>
> Tom
> --
> View this message in context:
> http://n2.nabble.com/Google-protocol-Buffer-Codec-tp4241485p4241485.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20100102/006eff9c/attachment.html
More information about the netty-users
mailing list