示例#1
0
        public PendingWriteQueue(IChannelHandlerContext ctx)
        {
            Contract.Requires(ctx != null);

            this.ctx = ctx;
            this.buffer = ctx.Channel.Unsafe.OutboundBuffer;
            this.estimatorHandle = ctx.Channel.Configuration.MessageSizeEstimator.NewHandle();
        }
示例#2
0
        public PendingWriteQueue(IChannelHandlerContext ctx)
        {
            Contract.Requires(ctx != null);

            this.ctx             = ctx;
            this.buffer          = ctx.Channel.Unsafe.OutboundBuffer;
            this.estimatorHandle = ctx.Channel.Configuration.MessageSizeEstimator.NewHandle();
        }
示例#3
0
 protected PendingBytesTracker(IMessageSizeEstimatorHandle estimatorHandle)
 {
     if (estimatorHandle is null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.estimatorHandle);
     }
     _estimatorHandle = estimatorHandle;
 }
示例#4
0
        public BatchingPendingWriteQueue(IChannelHandlerContext ctx, int maxSize)
        {
            if (ctx is null)
            {
                ThrowHelper.ThrowArgumentNullException(ExceptionArgument.ctx);
            }

            _ctx             = ctx;
            _maxSize         = maxSize;
            _buffer          = ctx.Channel.Unsafe.OutboundBuffer;
            _estimatorHandle = ctx.Channel.Configuration.MessageSizeEstimator.NewHandle();
        }
示例#5
0
 /// <summary>
 /// Create a new instance
 ///
 /// @param unknownSize       The size which is returned for unknown messages.
 /// </summary>
 public DefaultMessageSizeEstimator(int unknownSize)
 {
     Contract.Requires(unknownSize >= 0);
     this.handle = new HandleImpl(unknownSize);
 }
 /// <summary>
 ///     Create a new instance
 ///     @param unknownSize       The size which is returned for unknown messages.
 /// </summary>
 public DefaultMessageSizeEstimator(int unknownSize)
 {
     Contract.Requires(unknownSize >= 0);
     this.handle = new HandleImpl(unknownSize);
 }
示例#7
0
 public ChannelOutboundBufferPendingBytesTracker(ChannelOutboundBuffer buffer, IMessageSizeEstimatorHandle estimatorHandle)
     : base(estimatorHandle)
 {
     _buffer = buffer;
 }
示例#8
0
 public NoopPendingBytesTracker(IMessageSizeEstimatorHandle estimatorHandle) : base(estimatorHandle)
 {
 }
 private DefaultMessageSizeEstimator(int unknownSize)
 {
     _handle = new DefaultHandle(unknownSize);
 }
示例#10
0
 private DefaultMessageSizeEstimator(int unknownSize)
 {
     _handle = new DefaultHandle(unknownSize);
 }