login about faq

My applications have long been using Chilkat to establish an SSH tunnel and communicate with a MySQL server through that tunnel. It's been working very well, even with multiple connections taking place on the tunnel at the same time.

I recently upgraded from 9.5.0.48 (ChilkatDotNet4.dll) to 9.5.0.58 (ChilkatDotNet46.dll). There were some small modifications I needed to make based on some of the new functionality in the new version, but got everything working properly. I am NOT using dynamic port forwarding.

After the upgrade, I noticed my connections to my MySQL server would fail with a "Reading from the stream has failed" error message. This looks like it occurs when I have two different threads accessing the MySQL server through the tunnel at the same time. It's caused a lot of instability in my applications, and I'm trying to pinpoint it. When I revert back to 9.5.0.48 (ChilkatDotNet4.dll), everything works perfectly fine again. The MySQL and SSH servers have remained constant between my tests, so I've narrowed it to the Chilkat library. Here is how I am establishing my tunnels in both the old and new versions:

Version 9.5.0.48 (ChilkatDotNet4.dll)

    mainTunnel.UnlockComponent("XXXXXX");

    // Set SSH properties
    mainTunnel.SshHostname = sshServer;
    mainTunnel.SshPort = sshPort;
    mainTunnel.SshLogin = sshLogin;
    mainTunnel.SshPassword = sshPassword;

    // Set endpoint properties
    mainTunnel.DestHostname = mysqlServer;
    mainTunnel.DestPort = mysqlPort;

    // Begin accepting connections
    mainTunnel.BeginAccepting(Convert.ToInt32(tunnelPort));

    // Set endpoint properties
    mainTunnel.DestHostname = mysqlServer;
    mainTunnel.DestPort = mysqlPort;

    // Begin accepting connections
    mainTunnel.BeginAccepting(Convert.ToInt32(tunnelPort));

Version 9.5.0.58 (ChilkatDotNet4.dll)

    mainTunnel.UnlockComponent("XXXXXX");
    mainTunnel.DynamicPortForwarding = false;

    // Connect to the SSH server
    if (mainTunnel.Connect(sshServer, sshPort) == false)
    {
        return new KeyValuePair<bool, string>(false, mainTunnel.LastErrorText);
    }

    // Authenticate to the SSH server
    if (mainTunnel.AuthenticatePw(sshLogin, sshPassword) == false)
    {
        return new KeyValuePair<bool, string>(false, mainTunnel.LastErrorText);
    }

    // Set endpoint properties
    mainTunnel.DestHostname = mysqlServer;
    mainTunnel.DestPort = mysqlPort;

    // Begin accepting connections
    if (mainTunnel.BeginAccepting(Convert.ToInt32(tunnelPort)) == false)
    {
        return new KeyValuePair<bool, string>(false, mainTunnel.LastErrorText);
    }

asked Sep 01 at 14:49

mlager's gravatar image

mlager
1

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×23
×13

Asked: Sep 01 at 14:49

Seen: 232 times

Last updated: Sep 01 at 14:49

powered by OSQA