title: chess game online: how to design the server
body: <p>I'm developing a chess game online.<br></p>
  
  <p>My idea is to make the server as the place where the data communicate from one player to the other.<br></p>
  
  <p>So here is my plan to continue:<br>
  When two players connect the server(with TCP), the server create two threads for both of them. It means that the two threads need to communicate each other.<br></p>
  
  <pre><code>// server
  while(true)
  {
      if(socket.accept())
      {
          create_a_thread(); // handle one player
      }
  }
  </code></pre>
  
  <p>But one game needs two threads in the server? I don't think this is a good design.<br></p>
  
  <p>How should I redesign my server?</p>