/// <summary> /// 对数据的打包处理 /// </summary> private void DealEventPool() { while (true) { SocketEventParam param = _socketEventPool.GetObj(); if (param == null) { break; } if (param.SocketEvent == EN_SocketEvent.close) { var aa = _clientGroup.TryRemove(param.Socket, out _); if (!aa) { Console.WriteLine("_clientGroup TryRemove False"); } } //if (PacketMinLen == 0) //字节流处理 //{ OnSocketPacketEvent?.Invoke(param); //} } }
/// <summary> /// package中添加的事件方法 /// </summary> /// <param name="param"></param> public void PutClientPacket(SocketEventParam param) { OnSocketPacketEvent?.Invoke(param); }