I've started with one of the simple protobuf examples of writing to a file, 
then reading back. I've extended it a little to try to use both oneof, and 
serialisation with a length field in front so that I can read multiple 
messages.

The proto file is:

syntax = "proto3";

package pbuf;

message GetRequest {
    enum GetTarget {
        FIRST = 0;
        SECOND = 1;
    }

    GetTarget get_target = 1;
}

message SetRequest {
    enum SetTarget {
        FIRST = 0;
        SECOND = 1;
    }

    SetTarget set_target = 1;
}

message Request {
    oneof request_type {
        SetRequest s_request = 1;
        GetRequest g_request = 2;
    }
}


-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/23a61cfc-6e23-48fe-bc4c-455f61c2a09an%40googlegroups.com.

Reply via email to