title: Websocket - dividing a message
body: <p>For a real-time multiplayer game, the server is sending <strong>binary</strong> <strong>messages</strong> to the client with Websocket. </p>
  
  <p>The first byte (uint8) of a message would be the "<strong>packet ID</strong>". </p>
  
  <p><strong>Example</strong>: packet 1 to "update entity": x, y, score, name in the next bytes.</p>
  
  <p>But, to <strong>optimize the bandwidth</strong>, I would like to send only values that <strong>change</strong> between 2 frames.</p>
  
  <p><strong>Example (all values changed)</strong>: packet 2 to "update entity position": x, y</p>
  
  <p>packet 3 to "update entity score": score</p>
  
  <p>packet 4 to "update entity name": name</p>
  
  <p>My question is: is sending a lot of messages (packet 2, 3, 4) the <strong>same</strong> than sending 1 message (1 packet) not divided, in term of <strong>size</strong> (without considering the additional "packet ID" byte, negligible)  ? Isn't there an additional cost to each Websocket message ?</p>