I couldn't find a proper guide to send and receive protobuf messages over network. The example from tutorial shows how to read from and write to a file. So a naive approach would be to create a custom header for a network protocol and send protobuf files. Header also contains enumeration value for a type of the message.
So the question is: Does protobuf provide an API to read a message's header to be able to distinguish its type and length?If it does, can it be acquired without receiving the whole message?