mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-16 05:04:48 +00:00
Fix tcp client config object.
This commit is contained in:
@@ -311,22 +311,29 @@ namespace PepperDash.Core
|
|||||||
Key = key;
|
Key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initialize called by the constructor that accepts a client config object. Can be called later to reset properties of client.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="clientConfigObject"></param>
|
||||||
public void Initialize(TcpClientConfigObject clientConfigObject)
|
public void Initialize(TcpClientConfigObject clientConfigObject)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (clientConfigObject != null)
|
if (clientConfigObject != null)
|
||||||
{
|
{
|
||||||
Hostname = clientConfigObject.Address;
|
var TcpSshProperties = clientConfigObject.Control.TcpSshProperties;
|
||||||
AutoReconnect = clientConfigObject.AutoReconnect;
|
Hostname = TcpSshProperties.Address;
|
||||||
AutoReconnectIntervalMs = clientConfigObject.AutoReconnectIntervalMs > 1000 ? clientConfigObject.AutoReconnectIntervalMs : 5000;
|
AutoReconnect = TcpSshProperties.AutoReconnect;
|
||||||
|
AutoReconnectIntervalMs = TcpSshProperties.AutoReconnectIntervalMs > 1000 ?
|
||||||
|
TcpSshProperties.AutoReconnectIntervalMs : 5000;
|
||||||
SharedKey = clientConfigObject.SharedKey;
|
SharedKey = clientConfigObject.SharedKey;
|
||||||
SharedKeyRequired = clientConfigObject.SharedKeyRequired;
|
SharedKeyRequired = clientConfigObject.SharedKeyRequired;
|
||||||
HeartbeatEnabled = clientConfigObject.HeartbeatRequired;
|
HeartbeatEnabled = clientConfigObject.HeartbeatRequired;
|
||||||
HeartbeatRequiredIntervalInSeconds = clientConfigObject.HeartbeatRequiredIntervalInSeconds > 0 ? clientConfigObject.HeartbeatRequiredIntervalInSeconds : (ushort)15;
|
HeartbeatRequiredIntervalInSeconds = clientConfigObject.HeartbeatRequiredIntervalInSeconds > 0 ?
|
||||||
|
clientConfigObject.HeartbeatRequiredIntervalInSeconds : (ushort)15;
|
||||||
HeartbeatString = string.IsNullOrEmpty(clientConfigObject.HeartbeatStringToMatch) ? "heartbeat" : clientConfigObject.HeartbeatStringToMatch;
|
HeartbeatString = string.IsNullOrEmpty(clientConfigObject.HeartbeatStringToMatch) ? "heartbeat" : clientConfigObject.HeartbeatStringToMatch;
|
||||||
Port = clientConfigObject.Port;
|
Port = TcpSshProperties.Port;
|
||||||
BufferSize = clientConfigObject.BufferSize > 2000 ? clientConfigObject.BufferSize : 2000;
|
BufferSize = TcpSshProperties.BufferSize > 2000 ? TcpSshProperties.BufferSize : 2000;
|
||||||
ReceiveQueueSize = clientConfigObject.ReceiveQueueSize > 20 ? clientConfigObject.ReceiveQueueSize : 20;
|
ReceiveQueueSize = clientConfigObject.ReceiveQueueSize > 20 ? clientConfigObject.ReceiveQueueSize : 20;
|
||||||
MessageQueue = new CrestronQueue<GenericTcpServerCommMethodReceiveTextArgs>(ReceiveQueueSize);
|
MessageQueue = new CrestronQueue<GenericTcpServerCommMethodReceiveTextArgs>(ReceiveQueueSize);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,12 @@ namespace PepperDash.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Client config object for TCP client with server that inherits from TcpSshPropertiesConfig and adds properties for shared key and heartbeat
|
/// Client config object for TCP client with server that inherits from TcpSshPropertiesConfig and adds properties for shared key and heartbeat
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TcpClientConfigObject : TcpSshPropertiesConfig
|
public class TcpClientConfigObject
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// TcpSsh Properties
|
||||||
|
/// </summary>
|
||||||
|
public ControlPropertiesConfig Control { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Bool value for secure. Currently not implemented in TCP sockets as they are not dynamic
|
/// Bool value for secure. Currently not implemented in TCP sockets as they are not dynamic
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user