Examples of ResetFrame


Examples of org.eclipse.jetty.http2.frames.ResetFrame

        return Result.PENDING;
    }

    private Result onReset(int error)
    {
        ResetFrame frame = new ResetFrame(getStreamId(), error);
        reset();
        return notifyReset(frame) ? Result.ASYNC : Result.COMPLETE;
    }
View Full Code Here

Examples of org.eclipse.jetty.http2.frames.ResetFrame

        // The stream is now gone, we must close it to
        // avoid that its idle timeout is rescheduled.
        close();

        // Tell the other peer that we timed out.
        reset(new ResetFrame(getId(), ErrorCodes.CANCEL_STREAM_ERROR), Callback.Adapter.INSTANCE);

        // Notify the application.
        notifyFailure(this, timeout);
    }
View Full Code Here

Examples of org.eclipse.jetty.http2.frames.ResetFrame

    public void abort(Throwable failure)
    {
        if (LOG.isDebugEnabled())
            LOG.debug("HTTP2 Response #{} aborted", stream.getId());
        if (!stream.isReset())
            stream.reset(new ResetFrame(stream.getId(), ErrorCodes.INTERNAL_ERROR), Callback.Adapter.INSTANCE);
    }
View Full Code Here

Examples of org.eclipse.jetty.http2.frames.ResetFrame

        {
            int remoteCount = remoteStreamCount.get();
            int maxCount = getMaxRemoteStreams();
            if (maxCount >= 0 && remoteCount >= maxCount)
            {
                reset(new ResetFrame(streamId, ErrorCodes.REFUSED_STREAM_ERROR), Callback.Adapter.INSTANCE);
                return null;
            }
            if (remoteStreamCount.compareAndSet(remoteCount, remoteCount + 1))
                break;
        }
View Full Code Here

Examples of org.eclipse.jetty.http2.frames.ResetFrame

    }

    @Override
    public void generate(ByteBufferPool.Lease lease, Frame frame)
    {
        ResetFrame resetFrame = (ResetFrame)frame;
        generateReset(lease, resetFrame.getStreamId(), resetFrame.getError());
    }
View Full Code Here

Examples of org.eclipse.jetty.http2.frames.ResetFrame

        {
            @Override
            public Stream.Listener onPush(Stream stream, PushPromiseFrame frame)
            {
                // Reset the stream as soon as we see the push.
                ResetFrame resetFrame = new ResetFrame(stream.getId(), ErrorCodes.REFUSED_STREAM_ERROR);
                stream.reset(resetFrame, Callback.Adapter.INSTANCE);
                return new Adapter()
                {
                    @Override
                    public void onData(Stream stream, DataFrame frame, Callback callback)
View Full Code Here

Examples of org.eclipse.jetty.http2.frames.ResetFrame

        MetaData.Request request = newRequest("GET", new HttpFields());
        HeadersFrame requestFrame = new HeadersFrame(0, request, null, false);
        FuturePromise<Stream> promise = new FuturePromise<>();
        client.newStream(requestFrame, promise, new Stream.Listener.Adapter());
        Stream stream = promise.get(5, TimeUnit.SECONDS);
        ResetFrame resetFrame = new ResetFrame(stream.getId(), ErrorCodes.CANCEL_STREAM_ERROR);
        FutureCallback resetCallback = new FutureCallback();
        stream.reset(resetFrame, resetCallback);
        resetCallback.get(5, TimeUnit.SECONDS);
        // After reset the stream should be gone.
        Assert.assertEquals(0, client.getStreams().size());
View Full Code Here

Examples of org.eclipse.jetty.http2.frames.ResetFrame

        MetaData.Request request = newRequest("GET", new HttpFields());
        HeadersFrame requestFrame = new HeadersFrame(0, request, null, false);
        FuturePromise<Stream> promise = new FuturePromise<>();
        client.newStream(requestFrame, promise, new Stream.Listener.Adapter());
        Stream stream = promise.get(5, TimeUnit.SECONDS);
        ResetFrame resetFrame = new ResetFrame(stream.getId(), ErrorCodes.CANCEL_STREAM_ERROR);
        stream.reset(resetFrame, Callback.Adapter.INSTANCE);

        Assert.assertTrue(resetLatch.await(5, TimeUnit.SECONDS));

        // Wait a while to let the server remove the
View Full Code Here

Examples of org.eclipse.jetty.http2.frames.ResetFrame

                stream2DataLatch.countDown();
            }
        });
        Stream stream2 = promise2.get(5, TimeUnit.SECONDS);

        ResetFrame resetFrame = new ResetFrame(stream1.getId(), ErrorCodes.CANCEL_STREAM_ERROR);
        stream1.reset(resetFrame, Callback.Adapter.INSTANCE);

        Assert.assertTrue(serverResetLatch.await(5, TimeUnit.SECONDS));
        // Stream MUST NOT receive data sent by server after reset.
        Assert.assertFalse(stream1DataLatch.await(1, TimeUnit.SECONDS));
View Full Code Here

Examples of org.eclipse.jetty.http2.frames.ResetFrame

        client.newStream(frame, new FuturePromise<Stream>(), new Stream.Listener.Adapter()
        {
            @Override
            public void onHeaders(Stream stream, HeadersFrame frame)
            {
                stream.reset(new ResetFrame(stream.getId(), ErrorCodes.CANCEL_STREAM_ERROR), Callback.Adapter.INSTANCE);
                resetLatch.countDown();
            }
        });

        Assert.assertTrue(dataLatch.await(5, TimeUnit.SECONDS));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.