Esempio n. 1
0
        // 接收数据
        public void OnReceived(IClientNetConnection connection, NetMessage msg)
        {
            lock (dataQueue)
                dataQueue.Enqueue(msg);

            Debug.WriteLine(msg.Buffer.Length);
        }
Esempio n. 2
0
 public void OnDisconnected(IClientNetConnection connection)
 {
     foreach (TCPClient client in clientList)
     {
         client.Stop();
         client.Start();
     }
 }
Esempio n. 3
0
 // 断开之后重连
 public void OnDisconnected(IClientNetConnection connection)
 {
     try
     {
         client.Stop();
         client.Start();
     }
     catch (Exception ex)
     {
         Log4Allen.WriteLog(typeof(GXStroreClient), ex.Message);
     }
 }
Esempio n. 4
0
        // 接收数据
        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);
            }
        }
Esempio n. 5
0
 public void OnSent(IClientNetConnection connection, NetMessage msg)
 {
 }
Esempio n. 6
0
 public void OnReceived(IClientNetConnection connection, NetMessage msg)
 {
     DealRecvData(msg.Buffer);
 }
Esempio n. 7
0
 public void OnConnected(IClientNetConnection connection)
 {
     client.SetConnection(connection);
 }
Esempio n. 8
0
 public void OnConnected(IClientNetConnection connection)
 {
 }
Esempio n. 9
0
 /// <summary>
 /// 设置链路
 /// </summary>
 /// <param name="conn"></param>
 public void SetConnection(IClientNetConnection conn)
 {
     _connection = conn;
 }