title: Sending variable length arrays over a network?
body: <p>In the game I'm making, I nee to be able to send std::vectors of integer over a network.</p>
  
  <p>A packet seems to be made up entirely of a string. Since enet, the network libray im using takes care of endian, my first idea on solving this is to send a messsage where the first byte is the message id, as usual, the next 4 bytes would be an integer indicating the length of the array, and all subsequent bytes would be  the ints in the array. On the client side I can then push these back into a vector.</p>
  
  <p>Is this how it is usually done or am I missing something critical? Is there a better way to do it?</p>
  
  <p>Thanks</p>