title: Java Threading within TCP and server sockets
body: <p>I have written the following two lines</p>
  
  <pre><code>ServerSocket mobCom = new ServerSocket(9846);
  Socket server = mobCom.accept();
  </code></pre>
  
  <p>I want a new TCP connection to be created and that connection to be handled by a new thread. For example the above code creates a server socket. And there are multiple clients. Whenever a client connects to a server a new thread may be created that will cater to requests coming from that particular client. How do I implement the same.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I also want to limit a thread pool to 10 users. And if more users arise I want to send them an error message without processing further requests from them.</p>