title: Creating a forwarded port within an SSH tunnel
body: <p>I'm attempting to use <a href="http://sshnet.codeplex.com/">SSH.NET</a> to create a tunnel from <code>localhost:3306</code> to port 3306 on a remote machine:</p>
  
  <pre><code>  PrivateKeyFile file = new PrivateKeyFile(@" .. path to private key .. ");
    using (var client = new SshClient(" .. remote server .. ", "ubuntu", file))
    {
  
        client.Connect();
        var port = new ForwardedPortLocal(3306, "localhost", 3306);
        client.AddForwardedPort(port);
        port.Start();
  
              // breakpoint set within the code here
  
        client.Disconnect();
    }
  </code></pre>
  
  <p>When the breakpoint is hit, <code>client.IsConnected</code> is returning <code>true</code>, but <code>telnet localhost 3306</code> is not connecting. If I create the connection using Putty instead, and set up the same tunnel there, it succeeds. What have I missed?</p>