Package org.eclipse.jetty.spdy.frames

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


        return false;
    }

    private void onDataFrame(ByteBuffer bytes)
    {
        DataFrame frame = new DataFrame(streamId, flags, bytes.remaining());
        onDataFrame(frame, bytes);
        reset();
    }
View Full Code Here


        reset();
    }

    private void onDataFragment(ByteBuffer bytes)
    {
        DataFrame frame = new DataFrame(streamId, (byte)(flags & ~DataInfo.FLAG_CLOSE), bytes.remaining());
        onDataFrame(frame, bytes);
        // Do not reset, we're expecting more data
    }
View Full Code Here

        final CountDownLatch createdListenerCalledLatch = new CountDownLatch(1);
        final CountDownLatch closedListenerCalledLatch = new CountDownLatch(1);
        session.addListener(new TestStreamListener(createdListenerCalledLatch, closedListenerCalledLatch));
        IStream stream = createStream();
        session.onControlFrame(new SynReplyFrame(VERSION, (byte)0, stream.getId(), new Fields()));
        session.onDataFrame(new DataFrame(stream.getId(), SynInfo.FLAG_CLOSE, 128), ByteBuffer.allocate(128));
        stream.data(new StringDataInfo("close", true));
        assertThat("onStreamCreated listener has been called", createdListenerCalledLatch.await(5, TimeUnit.SECONDS), is(true));
        assertThatOnStreamClosedListenerHasBeenCalled(closedListenerCalledLatch);
    }
View Full Code Here

                        onDataCalledLatch.countDown();
                        super.onData(stream, dataInfo);
                    }
                });
        session.onControlFrame(new SynReplyFrame(VERSION, SynInfo.FLAG_CLOSE, stream.getId(), headers));
        session.onDataFrame(new DataFrame(stream.getId(), (byte)0, 0), ByteBuffer.allocate(128));
        assertThat("onData is never called", onDataCalledLatch.await(1, TimeUnit.SECONDS), not(true));
    }
View Full Code Here

TOP

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

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.