Adds conditions for when creating a new Ssh client.

This commit is contained in:
Jason T Alborough
2019-10-11 05:59:10 -04:00
parent efe60b3ae0
commit 139777b501
2 changed files with 6 additions and 3 deletions

View File

@@ -221,7 +221,12 @@ namespace PepperDash.Core
Debug.Console(1, this, "Creating new SshClient");
ConnectionInfo connectionInfo = new ConnectionInfo(Hostname, Port, Username, pauth, kauth);
Client = new SshClient(connectionInfo);
if (Client == null)
{
Client = new SshClient(connectionInfo);
}
Client.ErrorOccurred -= Client_ErrorOccurred;
Client.ErrorOccurred += Client_ErrorOccurred;
//You can do it!

View File

@@ -250,8 +250,6 @@ namespace PepperDash.Core
if (Client == null)
{
Client = new TCPClient(Hostname, Port, BufferSize);
Client.SocketStatusChange += Client_SocketStatusChange;
}