public void DoesNotThrowForNullBuffers()
        {
            // This test was added because SslStream throws if passed null buffers with (count == 0)
            // Which happens if ProduceEnd is called in Frame without _responseStarted == true
            // As it calls ProduceStart with write immediate == true
            // This happens in WebSocket Upgrade over SSL

            ISocketOutput socketOutput = new StreamSocketOutput("id", new ThrowsOnNullWriteStream(), null, new TestKestrelTrace());

            // Should not throw
            socketOutput.Write(default(ArraySegment <byte>), true);

            Assert.True(true);
        }
Exemplo n.º 2
0
        public FilteredStreamAdapter(
            ConnectionId connectionId,
            Stream filteredStream,
            MemoryPool memory,
            IThreadPool threadPool,
            IBufferSizeControl bufferSizeControl)
        {
            SocketInput  = new SocketInput(memory, threadPool, bufferSizeControl);
            SocketOutput = new StreamSocketOutput(connectionId, filteredStream, memory);

            _connectionId   = connectionId;
            _filteredStream = filteredStream;
            _memory         = memory;
        }