title: C++/TCP Server - Convenient way of event notification
body: <p>I have created a simple C++ TCP Server application.</p>
  <p>Client connects and receives back as a simple echo everything that the client sends to the server. No purpose at all except for me to test the communication.</p>
  <p>So far so good. What comes as next task for me is to decide a way of how to send a notification to the server that specific event has started.</p>
  <p>Some event examples:</p>
  <ol>
  <li>Player wrote a message - Server accepts the data sent from the client and recognizes that it's a chat message and sends back data to all connected clients that there is new message. Clients recognize that there is new message incoming.</li>
  <li>Player is casting spell.</li>
  <li>Player has died</li>
  </ol>
  <p>Many more examples but you get the main idea.</p>
  <p>I was thinking of sending all the data in json format and there all messages will contain identifiers like</p>
  <pre><code>0x01 is message event.
  0x02 is casting spell event.
  0x03 is player dead event.
  </code></pre>
  <p>And once identifier is send server can recognize what event the client is asking/informing and can apply the needed logic behind.</p>
  <p>My question is isn't there a better approach to identify for what event the server is notified ?
  I am in a search of better approach before I take this road.</p>