/// <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; } }
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); } }
/// <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(); } }