public IncomingStart ( int minimumSize ) : IncomingBuffer | ||
minimumSize | int | |
return | IncomingBuffer |
private Libuv.uv_buf_t OnAlloc(UvStreamHandle handle, int suggestedSize) { var result = SocketInput.IncomingStart(2048); return(handle.Libuv.buf_init( result.DataPtr, result.Data.Count)); }
public void EmptyHeaderValuesCanBeParsed(string rawHeaders, int numHeaders) { var socketInput = new SocketInput(new MemoryPool2()); var headerCollection = new FrameRequestHeaders(); var headerArray = Encoding.ASCII.GetBytes(rawHeaders); var inputBuffer = socketInput.IncomingStart(headerArray.Length); Buffer.BlockCopy(headerArray, 0, inputBuffer.Data.Array, inputBuffer.Data.Offset, headerArray.Length); socketInput.IncomingComplete(headerArray.Length, null); var success = Frame.TakeMessageHeaders(socketInput, headerCollection); Assert.True(success); Assert.Equal(numHeaders, headerCollection.Count()); // Assert TakeMessageHeaders consumed all the input var scan = socketInput.ConsumingStart(); Assert.True(scan.IsEnd); }