mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-04-14 04:56:37 +00:00
Adds conditions for when creating a new Ssh client.
This commit is contained in:
parent
efe60b3ae0
commit
139777b501
2 changed files with 6 additions and 3 deletions
|
|
@ -221,7 +221,12 @@ namespace PepperDash.Core
|
||||||
|
|
||||||
Debug.Console(1, this, "Creating new SshClient");
|
Debug.Console(1, this, "Creating new SshClient");
|
||||||
ConnectionInfo connectionInfo = new ConnectionInfo(Hostname, Port, Username, pauth, kauth);
|
ConnectionInfo connectionInfo = new ConnectionInfo(Hostname, Port, Username, pauth, kauth);
|
||||||
|
|
||||||
|
if (Client == null)
|
||||||
|
{
|
||||||
Client = new SshClient(connectionInfo);
|
Client = new SshClient(connectionInfo);
|
||||||
|
}
|
||||||
|
Client.ErrorOccurred -= Client_ErrorOccurred;
|
||||||
Client.ErrorOccurred += Client_ErrorOccurred;
|
Client.ErrorOccurred += Client_ErrorOccurred;
|
||||||
|
|
||||||
//You can do it!
|
//You can do it!
|
||||||
|
|
|
||||||
|
|
@ -250,8 +250,6 @@ namespace PepperDash.Core
|
||||||
|
|
||||||
if (Client == null)
|
if (Client == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
Client = new TCPClient(Hostname, Port, BufferSize);
|
Client = new TCPClient(Hostname, Port, BufferSize);
|
||||||
Client.SocketStatusChange += Client_SocketStatusChange;
|
Client.SocketStatusChange += Client_SocketStatusChange;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue