testEchoStartedFromServer() — netty Function Reference
Architecture documentation for the testEchoStartedFromServer() function in QuicChannelEchoTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD b6b62dd4_732e_55a3_c880_96407c90f51b["testEchoStartedFromServer()"] 949dbf36_222b_a1d5_95aa_68ae528fcaf5["QuicChannelEchoTest"] b6b62dd4_732e_55a3_c880_96407c90f51b -->|defined in| 949dbf36_222b_a1d5_95aa_68ae528fcaf5 dc18ab1e_9653_f54e_3875_3668a65b6f02["EchoHandler()"] b6b62dd4_732e_55a3_c880_96407c90f51b -->|calls| dc18ab1e_9653_f54e_3875_3668a65b6f02 e1045f62_6ee7_c954_17a5_31211f40f0cd["channelActive()"] b6b62dd4_732e_55a3_c880_96407c90f51b -->|calls| e1045f62_6ee7_c954_17a5_31211f40f0cd e3494b32_ba2d_9829_4946_ef33056b5189["setAllocator()"] b6b62dd4_732e_55a3_c880_96407c90f51b -->|calls| e3494b32_ba2d_9829_4946_ef33056b5189 39d53d07_1929_f59b_be60_a52cbdc52542["writeAllData()"] b6b62dd4_732e_55a3_c880_96407c90f51b -->|calls| 39d53d07_1929_f59b_be60_a52cbdc52542 8f952ffb_218c_70bf_ea7f_e5e10f16983e["channelReadComplete()"] b6b62dd4_732e_55a3_c880_96407c90f51b -->|calls| 8f952ffb_218c_70bf_ea7f_e5e10f16983e b05ab098_a6d5_f522_4cfc_e7b527ff5c1b["waitForData()"] b6b62dd4_732e_55a3_c880_96407c90f51b -->|calls| b05ab098_a6d5_f522_4cfc_e7b527ff5c1b d03da1b0_2a83_47ce_bc9b_48796be3e619["checkForException()"] b6b62dd4_732e_55a3_c880_96407c90f51b -->|calls| d03da1b0_2a83_47ce_bc9b_48796be3e619 style b6b62dd4_732e_55a3_c880_96407c90f51b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-native-quic/src/test/java/io/netty/handler/codec/quic/QuicChannelEchoTest.java lines 114–211
@ParameterizedTest(name =
"{index}: autoRead = {0}, directBuffer = {1}, composite = {2}")
@MethodSource("data")
public void testEchoStartedFromServer(boolean autoRead, boolean directBuffer, boolean composite) throws Throwable {
ByteBufAllocator allocator = getAllocator(directBuffer);
final EchoHandler sh = new EchoHandler(true, autoRead, allocator);
final EchoHandler ch = new EchoHandler(false, autoRead, allocator);
AtomicReference<List<ChannelFuture>> writeFutures = new AtomicReference<>();
Channel server = QuicTestUtils.newServer(ImmediateExecutor.INSTANCE, new ChannelInboundHandlerAdapter() {
@Override
public void channelActive(ChannelHandlerContext ctx) {
setAllocator(ctx.channel(), allocator);
((QuicChannel) ctx.channel()).createStream(QuicStreamType.BIDIRECTIONAL, sh)
.addListener((Future<QuicStreamChannel> future) -> {
QuicStreamChannel stream = future.getNow();
setAllocator(stream, allocator);
List<ChannelFuture> futures = writeAllData(stream, composite, allocator);
writeFutures.set(futures);
});
ctx.channel().config().setAutoRead(autoRead);
if (!autoRead) {
ctx.read();
}
}
@Override
public void channelReadComplete(ChannelHandlerContext ctx) {
if (!autoRead) {
ctx.read();
}
}
}, sh);
setAllocator(server, allocator);
InetSocketAddress address = (InetSocketAddress) server.localAddress();
Channel channel = QuicTestUtils.newClient(ImmediateExecutor.INSTANCE);
QuicChannel quicChannel = null;
try {
quicChannel = QuicTestUtils.newQuicChannelBootstrap(channel)
.handler(new ChannelInboundHandlerAdapter() {
@Override
public void channelActive(ChannelHandlerContext ctx) {
if (!autoRead) {
ctx.read();
}
}
@Override
public void channelReadComplete(ChannelHandlerContext ctx) {
if (!autoRead) {
ctx.read();
}
}
})
.streamHandler(ch)
// Use the same allocator for the streams.
.streamOption(ChannelOption.ALLOCATOR, allocator)
.remoteAddress(address)
.option(ChannelOption.AUTO_READ, autoRead)
.option(ChannelOption.ALLOCATOR, allocator)
.connect()
.get();
waitForData(ch, sh);
for (;;) {
List<ChannelFuture> futures = writeFutures.get();
if (futures != null) {
for (ChannelFuture f: futures) {
f.sync();
}
break;
}
try {
Thread.sleep(50);
} catch (InterruptedException e) {
// Ignore.
}
}
waitForData(sh, ch);
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does testEchoStartedFromServer() do?
testEchoStartedFromServer() is a function in the netty codebase, defined in codec-native-quic/src/test/java/io/netty/handler/codec/quic/QuicChannelEchoTest.java.
Where is testEchoStartedFromServer() defined?
testEchoStartedFromServer() is defined in codec-native-quic/src/test/java/io/netty/handler/codec/quic/QuicChannelEchoTest.java at line 114.
What does testEchoStartedFromServer() call?
testEchoStartedFromServer() calls 7 function(s): EchoHandler, channelActive, channelReadComplete, checkForException, setAllocator, waitForData, writeAllData.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free