testWriteFlushPingPong() — netty Function Reference
Architecture documentation for the testWriteFlushPingPong() function in ReentrantChannelTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD b53ee246_8f81_f0bd_b037_e9d5a67324ad["testWriteFlushPingPong()"] 13a11eea_27b7_44b5_a4d5_69eb21dd0e09["ReentrantChannelTest"] b53ee246_8f81_f0bd_b037_e9d5a67324ad -->|defined in| 13a11eea_27b7_44b5_a4d5_69eb21dd0e09 style b53ee246_8f81_f0bd_b037_e9d5a67324ad fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
transport/src/test/java/io/netty/channel/ReentrantChannelTest.java lines 165–220
@Test
public void testWriteFlushPingPong() throws Exception {
LocalAddress addr = new LocalAddress("testWriteFlushPingPong");
ServerBootstrap sb = getLocalServerBootstrap();
sb.bind(addr).sync().channel();
Bootstrap cb = getLocalClientBootstrap();
setInterest(Event.WRITE, Event.FLUSH, Event.CLOSE, Event.EXCEPTION);
Channel clientChannel = cb.connect(addr).sync().channel();
clientChannel.pipeline().addLast(new ChannelOutboundHandlerAdapter() {
int writeCount;
int flushCount;
@Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
if (writeCount < 5) {
writeCount++;
ctx.channel().flush();
}
super.write(ctx, msg, promise);
}
@Override
public void flush(ChannelHandlerContext ctx) throws Exception {
if (flushCount < 5) {
flushCount++;
ctx.channel().write(createTestBuf(2000));
}
super.flush(ctx);
}
});
clientChannel.writeAndFlush(createTestBuf(2000));
clientChannel.close().sync();
assertLog(
"WRITE\n" +
"FLUSH\n" +
"WRITE\n" +
"FLUSH\n" +
"WRITE\n" +
"FLUSH\n" +
"WRITE\n" +
"FLUSH\n" +
"WRITE\n" +
"FLUSH\n" +
"WRITE\n" +
"FLUSH\n" +
"CLOSE\n");
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testWriteFlushPingPong() do?
testWriteFlushPingPong() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/ReentrantChannelTest.java.
Where is testWriteFlushPingPong() defined?
testWriteFlushPingPong() is defined in transport/src/test/java/io/netty/channel/ReentrantChannelTest.java at line 165.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free