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

            if (buffer != null)
            {
                buffer.Release();
                buffer = null;
            }
        }
示例#4
0
 internal static void ReleaseToPool(DogBuffer32K bufff)
 {
     lock (lockOjb)
     {
         bufff.Length = 0;
         s_pools32K.ReleaseContent(bufff);
     }
 }