// 接收数据 public void OnReceived(IClientNetConnection connection, NetMessage msg) { lock (dataQueue) dataQueue.Enqueue(msg); Debug.WriteLine(msg.Buffer.Length); }
public void OnDisconnected(IClientNetConnection connection) { foreach (TCPClient client in clientList) { client.Stop(); client.Start(); } }
// 断开之后重连 public void OnDisconnected(IClientNetConnection connection) { try { client.Stop(); client.Start(); } catch (Exception ex) { Log4Allen.WriteLog(typeof(GXStroreClient), ex.Message); } }
// 接收数据 public void OnReceived(IClientNetConnection connection, NetMessage msg) { // 态势数据 if (msg.Buffer.Length > 40 && bDealTsData == true) { lock (tsDataQueue) tsDataQueue.Enqueue(msg); } // 波束数据 if (msg.Buffer.Length < 40 && bDealBeamData == true) { lock (beamDataQueue) beamDataQueue.Enqueue(msg); } }
public void OnSent(IClientNetConnection connection, NetMessage msg) { }
public void OnReceived(IClientNetConnection connection, NetMessage msg) { DealRecvData(msg.Buffer); }
public void OnConnected(IClientNetConnection connection) { client.SetConnection(connection); }
public void OnConnected(IClientNetConnection connection) { }
/// <summary> /// 设置链路 /// </summary> /// <param name="conn"></param> public void SetConnection(IClientNetConnection conn) { _connection = conn; }