mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-15 12:44:48 +00:00
Working through ssh disconnect / leak problems
This commit is contained in:
@@ -11,7 +11,7 @@ using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace PepperDash.Core
|
||||
{
|
||||
public class GenericTcpIpClient : Device, IBasicCommunication
|
||||
public class GenericTcpIpClient : Device, IBasicCommunication, IAutoReconnect
|
||||
{
|
||||
public event EventHandler<GenericCommMethodReceiveBytesArgs> BytesReceived;
|
||||
public event EventHandler<GenericCommMethodReceiveTextArgs> TextReceived;
|
||||
@@ -21,6 +21,9 @@ namespace PepperDash.Core
|
||||
public string Status { get { return Client.ClientStatus.ToString(); } }
|
||||
public string ConnectionFailure { get { return Client.ClientStatus.ToString(); } }
|
||||
|
||||
public bool AutoReconnect { get; set; }
|
||||
public int AutoReconnectIntervalMs { get; set; }
|
||||
|
||||
public bool Connected
|
||||
{
|
||||
get { return Client.ClientStatus == SocketStatus.SOCKET_STATUS_CONNECTED; }
|
||||
@@ -173,9 +176,21 @@ namespace PepperDash.Core
|
||||
/// </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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user