예제 #1
0
 public void Recycle()
 {
     Buffers     = null;
     Buffer      = new ArraySegment <byte>();
     PendingSize = 0;
     Message     = null;
     Next        = null;
     Promise     = null;
     Count       = -1;
     Cancelled   = false;
     handle.Free(this);
 }
예제 #2
0
            public void Run()
            {
                try
                {
                    ChannelOutboundBuffer buffer = this.ctx.Channel.Unsafe.OutboundBuffer;
                    // Check for null as it may be set to null if the channel is closed already
                    if (EstimateTaskSizeOnSubmit)
                    {
                        buffer?.DecrementPendingOutboundBytes(this.size);
                    }
                    ChannelHandlerInvokerUtil.InvokeWriteAsyncNow(this.ctx, this.msg).LinkOutcome(this.promise);
                }
                finally
                {
                    // Set to null so the GC can collect them directly
                    this.ctx     = null;
                    this.msg     = null;
                    this.promise = null;

                    // recycle
                    _handle.Free(this);
                }
            }
예제 #3
0
 public void Recycle()
 {
     Num  = 0;
     Num2 = 0;
     _handle.Free(this);
 }