public void Initialize(TcpServerConfigObject serverConfigObject)
 {
     try
     {
         if (serverConfigObject != null || string.IsNullOrEmpty(serverConfigObject.Key))
         {
             Key               = serverConfigObject.Key;
             MaxClients        = serverConfigObject.MaxClients;
             Port              = serverConfigObject.Port;
             SharedKeyRequired = serverConfigObject.SharedKeyRequired;
             SharedKey         = serverConfigObject.SharedKey;
             HeartbeatRequired = serverConfigObject.HeartbeatRequired;
             HeartbeatRequiredIntervalInSeconds = serverConfigObject.HeartbeatRequiredIntervalInSeconds;
             HeartbeatStringToMatch             = serverConfigObject.HeartbeatStringToMatch;
             BufferSize       = serverConfigObject.BufferSize;
             ReceiveQueueSize = serverConfigObject.ReceiveQueueSize > 20 ? serverConfigObject.ReceiveQueueSize : 20;
             MessageQueue     = new CrestronQueue <GenericTcpServerCommMethodReceiveTextArgs>(ReceiveQueueSize);
         }
         else
         {
             ErrorLog.Error("Could not initialize server with key: {0}", serverConfigObject.Key);
         }
     }
     catch
     {
         ErrorLog.Error("Could not initialize server with key: {0}", serverConfigObject.Key);
     }
 }
Exemple #2
0
 public void Initialize(TcpServerConfigObject serverConfigObject)
 {
     try
     {
         if (serverConfigObject != null || string.IsNullOrEmpty(serverConfigObject.Key))
         {
             Key               = serverConfigObject.Key;
             MaxClients        = serverConfigObject.MaxClients;
             Port              = serverConfigObject.Port;
             SharedKeyRequired = serverConfigObject.SharedKeyRequired;
             SharedKey         = serverConfigObject.SharedKey;
             HeartbeatRequired = serverConfigObject.HeartbeatRequired;
             HeartbeatRequiredIntervalInSeconds = serverConfigObject.HeartbeatRequiredIntervalInSeconds;
             HeartbeatStringToMatch             = serverConfigObject.HeartbeatStringToMatch;
             BufferSize = serverConfigObject.BufferSize;
         }
         else
         {
             ErrorLog.Error("Could not initialize server with key: {0}", serverConfigObject.Key);
         }
     }
     catch
     {
         ErrorLog.Error("Could not initialize server with key: {0}", serverConfigObject.Key);
     }
 }
 /// <summary>
 /// Contstructor that sets all properties by calling the initialize method with a config object. This does set Queue size.
 /// </summary>
 /// <param name="serverConfigObject"></param>
 public GenericSecureTcpIpServer(TcpServerConfigObject serverConfigObject)
     : base("Uninitialized Secure TCP Server")
 {
     HeartbeatRequiredIntervalInSeconds             = 15;
     CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler);
     BufferSize = 2000;
     MonitorClientMaxFailureCount = 3;
     Initialize(serverConfigObject);
 }