EldoS | Feel safer!

Software components for data protection, secure storage and transfer

"SSH connection already established" error

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
Posted: 02/22/2012 13:29:41
by Andy Gardner (SUPPORT DISABLED)
Joined: 02/17/2012
Posts: 51

Is it possible to have an TElSimpleSSHClient connection and a TElSimpleSFTPClient connection to the same computer at the same time?

I have re-implemented my class for passing commands through the SSH client to reuse the existing instance of TElSimpleSSHClient, but I am still getting the exception with the "SSH connection already established" message.

The exception occurs during the constructor of my SSHProcess class (see below) when ExecuteCommand is called.

public SSHProcess(TElSimpleSSHClient sshClient, string command)
    this.sshClient = sshClient;


    byte[] stdErrData = new byte[BUFFER_SIZE];
    byte[] stdOutData = sshClient.ExecuteCommand(
        ref stdErrData);


Here is the relevant stack trace:
SBSimpleSSH.EElSimpleSSHClientError was caught
Message=SSH connection already established
at SBSimpleSSH.TElSimpleSSHClient.Open()
at SBSimpleSSH.TElSimpleSSHClient.InternalExecuteCommand(String Cmd, Byte[]& StdErrData, Boolean RedirectStdErr)
at SBSimpleSSH.TElSimpleSSHClient.ExecuteCommand(String Cmd, Byte[]& StdErrData)

What am I doing wrong?


Posted: 02/23/2012 03:22:32
by Vsevolod Ievgiienko (EldoS Corp.)

Could you please create a ticket in Helpdesk (https://www.eldos.com/helpdesk/index.php) and post a full project there. If will be easier to find out what is wrong.

The only reason could be that sshClient is already connected to the server before it is passed as a constructor parameter.
Posted: 02/24/2012 09:01:11
by Andy Gardner (SUPPORT DISABLED)
Joined: 02/17/2012
Posts: 51

I misunderstood the proper usage. I thought that you needed to open the connection before calling ExecuteCommand and I didn't realize that calling ExecuteCommand would open the connection.

I removed my call of Open() and that eliminated this error.

Thank you
Posted: 02/24/2012 10:58:32
by Eugene Mayevski (EldoS Corp.)

Please ignore my last message. Open is indeed called inside.

Sincerely yours
Eugene Mayevski



Topic viewed 2403 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!