mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-04-13 20:46:34 +00:00
SSH fixes and config changes
This commit is contained in:
parent
0f0b61afa2
commit
7a564bb8de
8 changed files with 57 additions and 30 deletions
|
|
@ -133,7 +133,6 @@ namespace PepperDash.Core
|
|||
{
|
||||
Client.Disconnect();
|
||||
Client = null;
|
||||
//Client.Dispose();
|
||||
}
|
||||
Client = new SshClient(connectionInfo);
|
||||
|
||||
|
|
@ -268,14 +267,6 @@ namespace PepperDash.Core
|
|||
}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Error event handler for stream events
|
||||
///// </summary>
|
||||
//void Stream_ErrorOccurred(object sender, ExceptionEventArgs e)
|
||||
//{
|
||||
// Debug.Console(2, this, "CRITICAL: PLEASE REPORT - SSH client stream error:\r{0}", e.Exception);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Error event handler for client events - disconnect, etc. Will forward those events via ConnectionChange
|
||||
/// event
|
||||
|
|
|
|||
|
|
@ -163,13 +163,17 @@ namespace PepperDash.Core
|
|||
}
|
||||
}
|
||||
|
||||
public class TcpIpConfig
|
||||
|
||||
public class TcpSshPropertiesConfig
|
||||
{
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string Address { get; set; }
|
||||
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public int Port { get; set; }
|
||||
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Defaults to 32768
|
||||
|
|
@ -186,12 +190,44 @@ namespace PepperDash.Core
|
|||
/// </summary>
|
||||
public int AutoReconnectIntervalMs { get; set; }
|
||||
|
||||
public TcpIpConfig()
|
||||
public TcpSshPropertiesConfig()
|
||||
{
|
||||
BufferSize = 32768;
|
||||
AutoReconnect = true;
|
||||
AutoReconnectIntervalMs = 5000;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//public class TcpIpConfig
|
||||
//{
|
||||
// [JsonProperty(Required = Required.Always)]
|
||||
// public string Address { get; set; }
|
||||
|
||||
// [JsonProperty(Required = Required.Always)]
|
||||
// public int Port { get; set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// Defaults to 32768
|
||||
// /// </summary>
|
||||
// public int BufferSize { get; set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// Defaults to true
|
||||
// /// </summary>
|
||||
// public bool AutoReconnect { get; set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// Defaults to 5000ms
|
||||
// /// </summary>
|
||||
// public int AutoReconnectIntervalMs { get; set; }
|
||||
|
||||
// public TcpIpConfig()
|
||||
// {
|
||||
// BufferSize = 32768;
|
||||
// AutoReconnect = true;
|
||||
// AutoReconnectIntervalMs = 5000;
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
//using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Core
|
||||
{
|
||||
public class SshConfig : TcpIpConfig
|
||||
{
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
}
|
||||
//namespace PepperDash.Core
|
||||
//{
|
||||
// public class SshConfig : TcpIpConfig
|
||||
// {
|
||||
// public string Username { get; set; }
|
||||
// public string Password { get; set; }
|
||||
// }
|
||||
//}
|
||||
Loading…
Add table
Add a link
Reference in a new issue