I was wondering what is the proper solution when you try to send a payload 
of arbitrary size while dealing with the possibility of fragmentation?

For example, if I serialize a struct of the following form:

struct a {
     int buffer_len;
     char* buf;
}

When I pack it, say my resulting byte array is 2000 bytes. When I receive 
this byte array and de-serialize into my struct a:

1) When I call read(), it returns the number of bytes read, what happens if 
this is <2000 (say, 1000 bytes) and I try to deserialize? Would I still get 
a struct a, with the correct buffer_len but only half of the data in buf? 
Or would protobuf throw somekind of error?
1) How do I know I have all 2048 bytes of my byte buffer?

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to