I am getting Proto3 messages from a server on the tcp, and the server team provided the proto3 file which I compiled and included in my project. So I parse the message in the following way successfully: Example message type 1:
bool ok = m1.ParseFromArray(tcp_buffer, tcp_len);
My question is: how would I parse a message from 5 possibly available, MessageType1-5? Is there any factory or reflection based parsing?
Please note my tcp buffer for a given message is complete, i.e. I have the full message encoded in the tcp_buffer from the server.
Any help will be appreciated.