I attempt to use compressed data for my socket programing.
The problem is the fixed output buffer size.

Message *request;
char buf[512];
stringbuf sbuf;
sbuf.pubsetbuf((char*)buf, sizeof(buf));
ostream os(&sbuf);
OstreamOutputStream *oos = new OstreamOutputStream(&os);
GzipOutputStream *gzout = new GzipOutputStream(oos);
request->SerializeToZeroCopyStream(gzout);

write(sd, buf, sizeof(buf));

I wanna use a loop to send the data.
But I don't know how to control the stream to output fixed-size data.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to