how to prevent over typing
<p>I am trying to make a simple chat application in c++. And it works but, If someone enters something while someone else is typing. It like writes over what they were typing. I linked pictures as examples below.</p>

<p>The code I am using for the client and the server can be found here:</p>

<p><a href="https://github.com/topkiller/networking/blob/master/Client.cpp" rel="nofollow">Client</a></p>

<p><a href="https://github.com/topkiller/networking/blob/master/Server.cpp" rel="nofollow">Server</a></p>

<p>Pictures:</p>

<p>Before
<img src="http://i.stack.imgur.com/H69OB.png" alt="enter image description here">
After
<img src="http://i.stack.imgur.com/Rl2XQ.png" alt="enter image description here"></p>
