public PendingWriteQueue(IChannelHandlerContext ctx) { if (ctx is null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.ctx); } _tracker = PendingBytesTracker.NewTracker(ctx.Channel); _ctx = ctx; }
/// <summary> /// Create a new instance. /// </summary> /// <param name="channel">the <see cref="IChannel"/> which will have the <see cref="IChannel.IsWritable"/> reflect the amount of queued /// buffers or <c>null</c> if there is no writability state updated.</param> /// <param name="initSize">the initial size of the underlying queue.</param> protected AbstractCoalescingBufferQueue(IChannel channel, int initSize) { _bufAndListenerPairs = new Deque <object>(initSize); _tracker = channel is null ? null : PendingBytesTracker.NewTracker(channel); }