/// <summary> /// 数据包写入器 /// </summary> /// <param name="codeId">消息报的id</param> public PacketWriter(ushort codeId) { buffer = DogBuffer.GetFromPool32K(); // 先预留2位用于存放消息id buffer.Length = 4; Write(codeId); }
internal static void ReleaseToPool(DogBuffer32K bufff) { lock (lockOjb) { bufff.Length = 0; s_pools32K.ReleaseContent(bufff); } }
/// <summary> /// 资源释放 /// </summary> public void Dispose(bool t) { if (!t) return; if (buffer != null) { buffer.Release(); buffer = null; } }