title: How do I telnet to a specific port on a Windows 8 Consumer Preview machine?
body: <p>I have been trying to troubleshoot a program that 'listens' on port 7751 for TCP connections.  In Windows 7 and before, sometimes I have to enable the port in any firewall software that exists but otherwise it works OK.</p>
  
  <p>In testing on Windows 8 Consumer Preview, my app is unable to start its 'listening' service, and I get the error: "No connection could be made because the target machine actively refused it".</p>
  
  <p>I turned off the Windows Firewall totally, to eliminate it, but the problem still exists (no other security software is installed on this Win8 box).</p>
  
  <p>In order to eliminate my program, I went through the "Turn on/off Windows features" applet in Control Panel, and installed Telnet Server and Client.  I have started the Telnet service (and made it automatic), and also added "Everybody" and myself specifically into the TelnetClients local group.</p>
  
  <p>When I run from the command line:   </p>
  
  <blockquote>
    <p>telnet 192.168.100.93 7751</p>
  </blockquote>
  
  <p>I am told "Could not open connection to the host, on port 7751".</p>
  
  <p>I tried the following:</p>
  
  <blockquote>
    <p>netstat -an | find /i "listening"</p>
  </blockquote>
  
  <p>But the port 7751 was not listed (and program that should listen on it was running).</p>
  
  <p>This port is not blocked by the firewall, as it is turned off.  </p>
  
  <p>I tried telnet to another port that was listed by the netstat command, and it works OK.</p>
  
  <p>My application connects to the port using the following:</p>
  
  <pre><code>System.Net.Sockets.TcpClient tcpc = new TcpClient();
  tcpc.Connect(server, port);
  </code></pre>
  
  <p>But the .Connect immediately sends it to the </p>
  
  <pre><code>catch(SocketException s)
  </code></pre>
  
  <p>Which reports the "No connection could be made because the target server actively refused it."  Note the "target server" is itself.</p>
  
  <p>My App is a regular Windows Forms app, in C#, which is built by Visual Studio 2005 (.net 2.0) on the Windows 8 box itself...</p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>EDIT:</strong> In answer to the question below, the code which starts the listening is:</p>
  
  <pre><code>private TcpListener tcpL;    
  IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, Configuration.portNumber);    
  tcpL = new TcpListener(ipEndPoint);    
  tcpL.Start();
  </code></pre>
  
  <p>(ipAddress and Configuration.portNumber are my IP address 192.168.100.93, and 7751 respectively).</p>
  
  <p>This code is within a try/catch and does not go to the catch, so I assume it started OK?</p>