/// <summary> /// 進行封包處理 /// </summary> /// <param name="o"></param> /// <param name="e"></param> private void Handler_Read(object o, ElapsedEventArgs e) { if (Reading) { return; } lock (_clientNode.Rx) { Reading = true; while (_clientNode.Rx.Count > 0) { byte[] buff = _clientNode.Rx.Dequeue(); if (buff != null && !buff.Length.Equals(1)) /* 如果是維持連線的訊號封包,則不予處理*/ { buff = Math.Serialize.Decompress(buff); IPacket packet = (IPacket)Math.Serialize.ToObject(buff); _clientNode.OnOperationRequest(packet); // 客戶端節點執行接收事件 } } Reading = false; } }