Beispiel #1
0
        /// <summary>
        /// TCP状态消息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnTcpStatus(object sender, CTcpConArgs e)
        {
            try
            {
                if (!e.bErr)
                {
                    if (!remoteClient.Contains(e.remoteIP))
                    {
                        remoteClient.Add(e.remoteIP);

                        ChangeClient();
                    }

                    SerLog.Log(e.conStatus, udcRunLog.ELog.Action);
                }
                else
                {
                    if (remoteClient.Contains(e.remoteIP))
                    {
                        remoteClient.Remove(e.remoteIP);

                        ChangeClient();
                    }

                    SerLog.Log(e.conStatus, udcRunLog.ELog.NG);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #2
0
 private void OnClientTcpCon(object sender, CTcpConArgs e)
 {
     if (!e.bErr)
     {
         clientLog.Log(e.conStatus, udcRunLog.ELog.Action);
     }
     else
     {
         clientLog.Log(e.conStatus, udcRunLog.ELog.NG);
     }
 }
Beispiel #3
0
        /// <summary>
        /// TCP状态消息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnTcpStatus(object sender, CTcpConArgs e)
        {
            try
            {
                _TCPLock.AcquireWriterLock(-1);

                if (!e.bErr)
                {
                    OnLogArgs.OnEvented(new CLogArgs(0, name, e.conStatus, (int)EResult.Action));
                }
                else
                {
                    OnLogArgs.OnEvented(new CLogArgs(0, name, e.conStatus, (int)EResult.NG));
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                _TCPLock.ReleaseWriterLock();
            }
        }