multipleFramesInFin() — netty Function Reference
Architecture documentation for the multipleFramesInFin() function in Http3FrameToHttpObjectCodecTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 79fd4172_6e2b_d99c_586f_719013f9972e["multipleFramesInFin()"] 0358625f_2420_3fbe_f6d7_5ee2577ca675["Http3FrameToHttpObjectCodecTest"] 79fd4172_6e2b_d99c_586f_719013f9972e -->|defined in| 0358625f_2420_3fbe_f6d7_5ee2577ca675 style 79fd4172_6e2b_d99c_586f_719013f9972e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http3/src/test/java/io/netty/handler/codec/http3/Http3FrameToHttpObjectCodecTest.java lines 972–1076
@Test
public void multipleFramesInFin() throws Exception {
EventLoopGroup group = new MultiThreadIoEventLoopGroup(1, NioIoHandler.newFactory());
try {
Bootstrap bootstrap = new Bootstrap()
.channel(NioDatagramChannel.class)
.handler(new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {
// initialized below
}
})
.group(group);
SelfSignedCertificate cert = new SelfSignedCertificate();
Channel server = bootstrap.bind("127.0.0.1", 0).sync().channel();
server.pipeline().addLast(Http3.newQuicServerCodecBuilder()
.initialMaxData(10000000)
.initialMaxStreamDataBidirectionalLocal(1000000)
.initialMaxStreamDataBidirectionalRemote(1000000)
.initialMaxStreamsBidirectional(100)
.sslContext(QuicSslContextBuilder.forServer(cert.key(), null, cert.cert())
.applicationProtocols(Http3.supportedApplicationProtocols()).build())
.tokenHandler(InsecureQuicTokenHandler.INSTANCE)
.handler(new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {
ch.pipeline().addLast(new Http3ServerConnectionHandler(new ChannelInboundHandlerAdapter() {
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof Http3HeadersFrame) {
DefaultHttp3HeadersFrame responseHeaders = new DefaultHttp3HeadersFrame();
responseHeaders.headers().status(HttpResponseStatus.OK.codeAsText());
ctx.write(responseHeaders, ctx.voidPromise());
ctx.write(new DefaultHttp3DataFrame(ByteBufUtil.encodeString(
ctx.alloc(), CharBuffer.wrap("foo"), CharsetUtil.UTF_8)),
ctx.voidPromise());
// send a fin, this also flushes
((DuplexChannel) ctx.channel()).shutdownOutput();
} else {
super.channelRead(ctx, msg);
}
}
}));
}
})
.build());
Channel client = bootstrap.bind("127.0.0.1", 0).sync().channel();
client.config().setAutoRead(true);
client.pipeline().addLast(Http3.newQuicClientCodecBuilder()
.initialMaxData(10000000)
.initialMaxStreamDataBidirectionalLocal(1000000)
.sslContext(QuicSslContextBuilder.forClient()
.trustManager(InsecureTrustManagerFactory.INSTANCE)
.applicationProtocols(Http3.supportedApplicationProtocols())
.build())
.build());
QuicChannel quicChannel = QuicChannel.newBootstrap(client)
.handler(new ChannelInitializer<QuicChannel>() {
@Override
protected void initChannel(QuicChannel ch) throws Exception {
ch.pipeline().addLast(new Http3ClientConnectionHandler());
}
})
.remoteAddress(server.localAddress())
.localAddress(client.localAddress())
.connect().get();
BlockingQueue<Object> received = new LinkedBlockingQueue<>();
QuicStreamChannel stream = Http3.newRequestStream(quicChannel, new Http3RequestStreamInitializer() {
@Override
protected void initRequestStream(QuicStreamChannel ch) {
ch.pipeline()
.addLast(new Http3FrameToHttpObjectCodec(false))
.addLast(new ChannelInboundHandlerAdapter() {
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
received.put(msg);
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does multipleFramesInFin() do?
multipleFramesInFin() is a function in the netty codebase, defined in codec-http3/src/test/java/io/netty/handler/codec/http3/Http3FrameToHttpObjectCodecTest.java.
Where is multipleFramesInFin() defined?
multipleFramesInFin() is defined in codec-http3/src/test/java/io/netty/handler/codec/http3/Http3FrameToHttpObjectCodecTest.java at line 972.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free