Package org.eclipse.jetty.spdy.frames

Examples of org.eclipse.jetty.spdy.frames.RstStreamFrame


    }

    private void onRstStream()
    {
        // TODO: check that statusCode is not 0
        RstStreamFrame frame = new RstStreamFrame(controlFrameParser.getVersion(), streamId, statusCode);
        controlFrameParser.onControlFrame(frame);
        reset();
    }
View Full Code Here


            public void onControlFrame(ControlFrame frame)
            {
                if (frame instanceof SynStreamFrame)
                {
                    int pushStreamId = ((SynStreamFrame)frame).getStreamId();
                    ByteBuffer writeBuffer = generator.control(new RstStreamFrame(version, pushStreamId, StreamStatus.CANCEL_STREAM.getCode(version)));
                    try
                    {
                        channel.write(writeBuffer);
                    }
                    catch (IOException e)
View Full Code Here

        }
        else
        {
            int streamId = rstInfo.getStreamId();
            IStream stream = streams.get(streamId);
            RstStreamFrame frame = new RstStreamFrame(version, streamId, rstInfo.getStreamStatus().getCode(version));
            control(stream, frame, rstInfo.getTimeout(), rstInfo.getUnit(), callback);
            if (stream != null)
            {
                stream.process(frame);
                flusher.removeFrameBytesFromQueue(stream);
View Full Code Here

    }

    @Override
    public ByteBuffer generate(ControlFrame frame)
    {
        RstStreamFrame rstStream = (RstStreamFrame)frame;

        int frameBodyLength = 8;
        int totalLength = ControlFrame.HEADER_LENGTH + frameBodyLength;
        ByteBuffer buffer = getByteBufferPool().acquire(totalLength, Generator.useDirectBuffers);
        BufferUtil.clearToFill(buffer);
        generateControlFrameHeader(rstStream, frameBodyLength, buffer);

        buffer.putInt(rstStream.getStreamId() & 0x7F_FF_FF_FF);
        buffer.putInt(rstStream.getStatusCode());

        buffer.flip();
        return buffer;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.spdy.frames.RstStreamFrame

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.