title: C++ IPC Communication
body: <p>I am in dilema to make decision on the below scenarios. Kindly need experts help.</p>
  
  <p>Scenario :  There is TCP/IP communication between two process running in two boxes. </p>
  
  <p><strong>Communication Method 1 :</strong> Stream based communication on the socket. Where on the receiver side , he will receive the entire byte buffer and interpret first few fixed bytes as header and desrialize it and get to know the message length and start take message of that length and deserialize it and proceed to next message header like that goes on....</p>
  
  <p><strong>Communication Method2 :</strong> Put all the messages in a vector and vector will be residing in a class object. serialize the class object in one go and send to receiver. Receiver deserialize the class object and read the vector array one by one.</p>
  
  <p>Please let me know which approach is efficient and if any other approach , please guide me.</p>
  
  <p>Also pros and cons of class based data transmission and structure based data transmission and which is suitable for which scenario ?</p>