Examples of PushInfo


Examples of org.eclipse.jetty.spdy.api.PushInfo

            @Override
            public StreamFrameListener onSyn(Stream stream, SynInfo synInfo)
            {
                try
                {
                    Stream pushStream = stream.push(new PushInfo(new Fields(), false));
                    stream.reply(new ReplyInfo(true));
                    // wait until stream is closed
                    streamClosedLatch.await(5, TimeUnit.SECONDS);
                    pushStream.data(new BytesDataInfo(transferBytes, true), new Callback.Adapter());
                    return null;
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.PushInfo

                    {
                        Stream pushStream = null;
                        try
                        {
                            stream.reply(new ReplyInfo(false), new Callback.Adapter());
                            pushStream = stream.push(new PushInfo(new Fields(), false));
                            resetReceivedLatch.await(5, TimeUnit.SECONDS);
                        }
                        catch (InterruptedException | ExecutionException | TimeoutException e)
                        {
                            e.printStackTrace();
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.PushInfo

        Session clientSession = startClient(startServer(new ServerSessionFrameListener.Adapter()
        {
            @Override
            public StreamFrameListener onSyn(Stream stream, SynInfo synInfo)
            {
                stream.push(new PushInfo(new Fields(), false), new Promise.Adapter<Stream>());
                return null;
            }
        }), null);

        Stream stream = clientSession.syn(new SynInfo(new Fields(), false),
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.PushInfo

    }

    private void createPushStreamAndMakeSureItFails(IStream stream) throws InterruptedException
    {
        final CountDownLatch failedLatch = new CountDownLatch(1);
        PushInfo pushInfo = new PushInfo(5, TimeUnit.SECONDS, headers, false);
        stream.push(pushInfo, new Promise.Adapter<Stream>()
        {
            @Override
            public void failed(Throwable x)
            {
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.PushInfo

    public void testPushStreamIsRemovedWhenReset() throws InterruptedException, ExecutionException, TimeoutException
    {
        setControllerWriteExpectation(false);

        IStream stream = createStream();
        IStream pushStream = (IStream)stream.push(new PushInfo(new Fields(), false));
        assertThatPushStreamIsInSession(pushStream);
        session.rst(new RstInfo(pushStream.getId(), StreamStatus.INVALID_STREAM));
        assertThatPushStreamIsNotInSession(pushStream);
        assertThatStreamIsNotAssociatedWithPushStream(stream, pushStream);
        assertThatStreamIsReset(pushStream);
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.PushInfo

    public void testPushStreamWithSynInfoClosedTrue() throws InterruptedException, ExecutionException, TimeoutException
    {
        setControllerWriteExpectation(false);

        IStream stream = createStream();
        PushInfo pushInfo = new PushInfo(5, TimeUnit.SECONDS, headers, true);
        IStream pushStream = (IStream)stream.push(pushInfo);
        assertThatPushStreamIsHalfClosed(pushStream);
        assertThatPushStreamIsClosed(pushStream);
        assertThatStreamIsNotAssociatedWithPushStream(stream, pushStream);
        assertThatStreamIsNotInSession(pushStream);
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.PushInfo

            TimeoutException
    {
        setControllerWriteExpectation(false);

        IStream stream = createStream();
        PushInfo pushInfo = new PushInfo(5, TimeUnit.SECONDS, headers, false);
        IStream pushStream = (IStream)stream.push(pushInfo);
        assertThatStreamIsAssociatedWithPushStream(stream, pushStream);
        assertThatPushStreamIsInSession(pushStream);
        pushStream.headers(new HeadersInfo(headers, true));
        assertThatPushStreamIsNotInSession(pushStream);
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.PushInfo

        Settings settings = new Settings();
        settings.put(new Settings.Setting(Settings.ID.MAX_CONCURRENT_STREAMS, 0));
        SettingsFrame settingsFrame = new SettingsFrame(VERSION, (byte)0, settings);
        session.onControlFrame(settingsFrame);

        PushSynInfo pushSynInfo = new PushSynInfo(1, new PushInfo(new Fields(), false));
        session.syn(pushSynInfo, null, new Promise.Adapter<Stream>()
        {
            @Override
            public void failed(Throwable x)
            {
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.PushInfo

        return (IStream)session.syn(synInfo, new StreamFrameListener.Adapter());
    }

    private IStream createPushStream(Stream stream) throws InterruptedException, ExecutionException, TimeoutException
    {
        PushInfo pushInfo = new PushInfo(5, TimeUnit.SECONDS, headers, false);
        return (IStream)stream.push(pushInfo);
    }
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.PushInfo

    {
        Stream stream = new StandardStream(synStreamFrame.getStreamId(), synStreamFrame.getPriority(), session, null, null, null);
        Set<Stream> streams = new HashSet<>();
        streams.add(stream);
        when(synStreamFrame.isClose()).thenReturn(false);
        PushInfo pushInfo = new PushInfo(new Fields(), false);
        when(session.getStreams()).thenReturn(streams);
        stream.push(pushInfo, new Promise.Adapter<Stream>());
        verify(session).syn(argThat(new PushSynInfoMatcher(stream.getId(), pushInfo)),
                any(StreamFrameListener.class), any(Promise.class));
    }
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.