login about faq

Hello,

I have a connection to mysql through an SSH tunnel which works without problems opening and closing the tunnel + Mysql connection in every transaction in the PHP application.

However after a while, the thread that is attempted to close upon completion of a task generates the following error:

ChilkatLog: StopAccepting: DllDate: Mar 23 2017 ChilkatVersion: 9.5.0.66 UnlockPrefix: Anything for 30-day trial. Architecture: Little Endian; 64-bit Language: Linux PHP VerboseLogging: 0 Stopping listen thread... Listen thread did not stop. Failed. --StopAccepting --ChilkatLog

my code sample

include("chilkat_9_5_0.php");
$chilkatGlob = new CkGlobal();
$success = $chilkatGlob->UnlockBundle('Anything for 30-day trial.');
if ($success != true) {
    print $chilkatGlob->lastErrorText() . "\n";
    exit;
}
$tunnel = new CkSshTunnel();
$sshHostname = 'SSH server client side';
$sshPort = 7001;
//  Connect to an SSH server and establish the SSH tunnel:
$success = $tunnel->Connect($sshHostname,$sshPort);
if ($success != true) {
    print $tunnel->lastErrorText() . "\n";
    exit;
}
$success = $tunnel->AuthenticatePw('jan','jan12');
if ($success != true) {
    print $tunnel->lastErrorText() . "\n";
    exit;
}
$tunnel->put_DestPort(3306);
$tunnel->put_DestHostname('mysql local server IP');
$listenPort = 3307;
$success = $tunnel->BeginAccepting($listenPort);
if ($success != true) {
    print $tunnel->lastErrorText() . "\n";
    exit;
}else{
    echo 'conectado';
}

//My mysql script executed by the application

//  Stop the background listen/accept thread:
$waitForThreadExit = true;
$success = $tunnel->StopAccepting($waitForThreadExit);
if ($success != true) {
    print $tunnel->lastErrorText() . "\n";
    exit;
}
//  Close the SSH tunnel (would also kick any remaining connected clients).
$success = $tunnel->CloseTunnel($waitForThreadExit);
if ($success != true) {
    print $tunnel->lastErrorText() . "\n";
    exit;
}

Any ideas? I think that something may be missing to close the SSH session correctly, causing the thread to not be closed.

asked May 11 at 09:45

Jan%20Roman's gravatar image

Jan Roman
1


Thanks Jan,

I think v9.5.0.67 may fix the problem. I'll post a build here when it's ready. (likely later today)

link

answered May 11 at 10:01

chilkat's gravatar image

chilkat ♦♦
12.8k317366477

thanks, i will take a look when you send.

(May 11 at 11:06) Jan Roman

What version of PHP are you using?

link

answered May 11 at 11:01

chilkat's gravatar image

chilkat ♦♦
12.8k317366477

My versión of PHP is PHP Version 5.4.16, and the complete senteces of server is: Apache Version Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_fcgid/2.3.9 PHP/5.4.16

(May 11 at 11:07) Jan Roman

The library i use is: chilkat-9.5.0-php-5.4-x86_64-linux

(May 11 at 11:08) Jan Roman
link

answered May 11 at 16:04

chilkat's gravatar image

chilkat ♦♦
12.8k317366477

Thank you, I will review how the application works with this version and comment here.

(May 11 at 16:35) Jan Roman
Your answer
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:

×106
×44
×33

Asked: May 11 at 09:45

Seen: 470 times

Last updated: May 11 at 16:35

powered by OSQA