Hello Alan,

     I am trying to change the network protocol to use GPB. The way I am doing 
this is,

     1. Building network message using protocol buffer class, NetworkMsg.
     2. Serialize the NetworkMsg to string, using GPB serialization API, 
SerializeToString(string *output).
     3. Sending it using send() 
     4. On receiving side, parsing string back to NetworkMsg using GPB parsing 
API, ParseFromString(const string& data)

  I am not getting this to work for following reasons,

   - The SerializeToString(string *output) API serializes the message
and stores the bytes in the given string. The bytes are

      binary and may have "\0". The send function uses 
add_to_output_buffer(const char* msg, unsigned int size) function. This
     function works on null-terminated c string and may endup removing data.
  - The receiving side of the message separates messages using "\n" but GPB 
serialized strings have many "\n". So on the receiving 
     side I am not able to Parse the string back to NetworkMsg. 


   Do you have any suggestions on how to move forward without having to do 
major changes in existing code.

Thanks,
Shilpa Sodani.
    
      
     
                                          
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Mira-development mailing list
Mira-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mira-development

Reply via email to