//private void ConnectServer()
 //{
 //}
 //private void DisconnectServer()
 //{
 //}
 private void AddLog(string msg = "", string ip = "", LogMessage.State state = LogMessage.State.None, LogMessage.Flow flow = LogMessage.Flow.None)
 {
     Dispatcher.Invoke((ThreadStart)delegate
     {
         if (_cts.Token.IsCancellationRequested == false)//lock (_logLock)
         {
             _logQueue.Enqueue(new LogMessage()
             {
                 Index = _logIndex++,
                 TimeStamp = DateTime.Now,
                 FlowType = flow,
                 StateType = state,
                 IPAddr = ip,
                 Message = msg
             });
         }
     }, null);
 }
 private void AddLog(string msg = "", string ip = "", LogMessage.State state = LogMessage.State.None, LogMessage.Flow flow = LogMessage.Flow.None)
 {
     Dispatcher.Invoke((ThreadStart)delegate
     {
         _logQueue.Enqueue(new LogMessage()
         {
             Index = _logIndex++,
             TimeStamp = DateTime.Now,
             FlowType = flow,
             StateType = state,
             IPAddr = ip,
             Message = msg
         });
     }, null);
 }