public FrameThriftMessage(ThriftTransportType transportType, IByteBuffer buffer)
     : base(buffer)
 {
     this.StrictWrite   = true;
     this.StrictRead    = false;
     this.TransportType = transportType;
 }
        public TThriftTransport(IChannel channel,
                                IByteBuffer inBuffer,
                                ThriftTransportType thriftTransportType, bool needReleaseInputBuffer = false)
        {
            this._channel                = channel;
            this._inBuffer               = inBuffer;
            this._thriftTransportType    = thriftTransportType;
            this._outBuffer              = Unpooled.Buffer(DEFAULT_OUTPUT_BUFFER_SIZE);
            this._initialReaderIndex     = inBuffer.ReaderIndex;
            this._needReleaseInputBuffer = needReleaseInputBuffer;

            if (!inBuffer.HasArray)
            {
                _buffer                = null;
                _bufferPosition        = 0;
                _initialBufferPosition = _bufferEnd = -1;
            }
            else
            {
                _buffer = inBuffer.Array;
                _initialBufferPosition = _bufferPosition = inBuffer.ArrayOffset + inBuffer.ReaderIndex;
                _bufferEnd             = _bufferPosition + inBuffer.ReadableBytes;
                // Without this, reading from a !in.hasArray() buffer will advance the readerIndex
                // of the buffer, while reading from a in.hasArray() buffer will not advance the
                // readerIndex, and this has led to subtle bugs. This should help to identify
                // those problems by making things more consistent.
                inBuffer.SetReaderIndex(inBuffer.ReaderIndex + inBuffer.ReadableBytes);
            }
        }
Exemple #3
0
 public ThriftMessage(IByteBuffer buffer, ThriftTransportType transportType)
 {
     this.Buffer        = buffer;
     this.TransportType = transportType;
 }
 public HeaderThriftMessage(ThriftTransportType transportType)
 {
     this.TransportType = transportType;
 }
Exemple #5
0
 public ThriftMessage(IByteBuffer content, ThriftTransportType transportType)
     : base(content)
 {
     this.TransportType = transportType;
 }
 public UnframeThriftMessage(ThriftTransportType transportType)
 {
     this.TransportType = transportType;
 }