title: Storing connected clients?
body: <p>I am currently learning and working on a Client/Server, and I am having some difficult on how I should store the connections.</p>
  
  <p>Here is some sample code:</p>
  
  <pre><code>while (_isRunning)
  {
      if (!tcpListener.Pending())
      {
          Thread.Sleep(200);
          continue;
      }
  
      TcpClient client = tcpListener.AcceptTcpClient();
      // TODO: handle connection
  }
  </code></pre>
  
  <p>I know I will have a handler that will receive/send data to that given client however, just having the handler would not allow me to do things like knowing how many clients are connected, sending a broadcast message or a shutdown message to all.</p>
  
  <p>Would storing client on a list be fine or should I store anything else ?</p>
  
  <p>What would be the correct way to store the clients connected in this case ?</p>