Google Protocol buffers in client/server when have different packet type [closed]?

Pangea noted self-describing messages, but actually I'd suggest union messages, if you don't know which type may be involved, but you know the complete spectrum of types available. (It depends on what exactly you mean by "I may not know the type in advance. ") Basically both techniques are "metadata, data" approaches - it just depends on whether the metadata needs to include the message descriptor, or just a discriminator to say which message type comes next.

You can combine the two techniques, of course - create a union type where one of the type involved is a self-describing type. This would be useful if you knew what you'd normally expect, but you'd occasionally get something "different" without knowing about the message type in advance.

1 for a complete answer – Pangea Sep 30 at 5:40.

Look at Self-describing Messages section of the documentation. NOTE: Jon Skeet's answer is a complete one as always.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions