Package io.netty.handler.codec.http2

Examples of io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder


    public void noMoreStreamIdsShouldSendGoAway() throws Exception {
        bootstrapEnv(1, 3);

        // Create a single stream by sending a HEADERS frame to the server.
        final Http2Headers headers = dummyHeaders();
        runInChannel(clientChannel, new Http2Runnable() {
            @Override
            public void run() {
                http2Client.encoder().writeHeaders(ctx(), 3, headers, 0, (short) 16, false, 0,
                        true, newPromise());
                http2Client.encoder().writeHeaders(ctx(), Integer.MAX_VALUE + 1, headers, 0, (short) 16, false, 0,
View Full Code Here


        try {
            // Initialize the data latch based on the number of bytes expected.
            bootstrapEnv(length, 2);

            // Create the stream and send all of the data at once.
            runInChannel(clientChannel, new Http2Runnable() {
                @Override
                public void run() {
                    http2Client.encoder().writeHeaders(ctx(), 3, headers, 0, (short) 16, false, 0,
                            false, newPromise());
                    http2Client.encoder().writeData(ctx(), 3, data.retain(), 0, true, newPromise());
View Full Code Here

            }
        }).when(serverListener).onDataRead(any(ChannelHandlerContext.class), anyInt(), eq(data),
                eq(0), eq(true));
        try {
            bootstrapEnv(numStreams * text.length(), numStreams * 3);
            runInChannel(clientChannel, new Http2Runnable() {
                @Override
                public void run() {
                    for (int i = 0, nextStream = 3; i < numStreams; ++i, nextStream += 2) {
                        http2Client.encoder().writeHeaders(ctx(), nextStream, headers, 0,
                                (short) 16, false, 0, false, newPromise());
View Full Code Here

            }
        }).when(serverListener).onDataRead(any(ChannelHandlerContext.class), eq(0x7FFFFFFF),
                any(ByteBuf.class), eq(100), eq(true));
        try {
            bootstrapEnv(1);
            runInChannel(clientChannel, new Http2Runnable() {
                @Override
                public void run() {
                    frameWriter.writeData(ctx(), 0x7FFFFFFF, data.slice().retain(), 100, true, newPromise());
                    ctx().flush();
                }
View Full Code Here

    @Test
    public void headersFrameWithoutPriorityShouldMatch() throws Exception {
        final Http2Headers headers = headers();
        bootstrapEnv(1);
        runInChannel(clientChannel, new Http2Runnable() {
            @Override
            public void run() {
                frameWriter.writeHeaders(ctx(), 0x7FFFFFFF, headers, 0, true, newPromise());
                ctx().flush();
            }
View Full Code Here

    @Test
    public void headersFrameWithPriorityShouldMatch() throws Exception {
        final Http2Headers headers = headers();
        bootstrapEnv(1);
        runInChannel(clientChannel, new Http2Runnable() {
            @Override
            public void run() {
                frameWriter.writeHeaders(ctx(), 0x7FFFFFFF, headers, 4, (short) 255,
                        true, 0, true, newPromise());
                ctx().flush();
View Full Code Here

            }
        }).when(serverListener).onGoAwayRead(any(ChannelHandlerContext.class), eq(0x7FFFFFFF),
                eq(0xFFFFFFFFL), eq(data));
        bootstrapEnv(1);
        try {
            runInChannel(clientChannel, new Http2Runnable() {
                @Override
                public void run() {
                    frameWriter.writeGoAway(ctx(), 0x7FFFFFFF, 0xFFFFFFFFL, data.retain(), newPromise());
                    ctx().flush();
                }
View Full Code Here

                return null;
            }
        }).when(serverListener).onPingAckRead(any(ChannelHandlerContext.class), eq(data));
        try {
            bootstrapEnv(1);
            runInChannel(clientChannel, new Http2Runnable() {
                @Override
                public void run() {
                    frameWriter.writePing(ctx(), true, data.retain(), newPromise());
                    ctx().flush();
                }
View Full Code Here

    }

    @Test
    public void priorityFrameShouldMatch() throws Exception {
        bootstrapEnv(1);
        runInChannel(clientChannel, new Http2Runnable() {
            @Override
            public void run() {
                frameWriter.writePriority(ctx(), 0x7FFFFFFF, 1, (short) 1, true, newPromise());
                ctx().flush();
            }
View Full Code Here

    @Test
    public void pushPromiseFrameShouldMatch() throws Exception {
        final Http2Headers headers = headers();
        bootstrapEnv(1);
        runInChannel(clientChannel, new Http2Runnable() {
            @Override
            public void run() {
                frameWriter.writePushPromise(ctx(), 0x7FFFFFFF, 1, headers, 5, newPromise());
                ctx().flush();
            }
View Full Code Here

TOP

Related Classes of io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder

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.