title: No connection could be made because the target machine actively refused it - using Socket or TcpClient
body: <p>Many people have this same problem, but everyone's implementation is different.</p>
  
  <p>I need help with my implementation of it.</p>
  
  <pre><code>void sendUsingTcp() 
  {
      try 
      {
          Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
          IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse(172.16.8.200), 8000);
          sock.Connect(endPoint);
          // code past this never hits because the line above fails
      } 
      catch (SocketException err) 
      {
          MessageBox.Show(err.Message);
      }
  }
  </code></pre>
  
  <p>I have also tried the TCP Client directly with the same error results:</p>
  
  <pre><code>void sendUsingTcp() 
  {
      try 
      {
          using (TcpClient client = new TcpClient()) 
          {
              IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse(172.16.8.200), 8000);
              client.Connect(endPoint);
              // code past this never hits because the line above fails
          }
      } 
      catch (SocketException err) 
      {
          MessageBox.Show(err.Message);
      }
  }
  </code></pre>
  
  <p>The IP Address of my PC is <code>172.16.11.144</code>.</p>