Ejemplo n.º 1
0
 /// <summary>
 /// 释放资源
 /// </summary>
 public void Dispose()
 {
     if (Interlocked.CompareExchange(ref isDisposed, 1, 0) == 0)
     {
         array.SetNull();
         bufferCount.Free();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 释放资源
        /// </summary>
        public void Dispose()
        {
            BufferCount bufferCount = Interlocked.Exchange(ref this.bufferCount, null);

            if (bufferCount != null)
            {
                bufferCount.Free();
                array.SetNull();
            }
        }
Ejemplo n.º 3
0
        private void free()
        {
            if (buffer != null)
            {
                buffer.Free();
                buffer = null;
            }
#if !DOTNET2
            if (async != null)
            {
                async.Completed -= onReceiveAsyncCallback;
                AutoCSer.Net.SocketAsyncEventArgsPool.PushNotNull(ref async);
            }
#endif
            queueTask.Dispose();
        }