QuicheQuicServerCodec Class — netty Architecture
Architecture documentation for the QuicheQuicServerCodec class in QuicheQuicServerCodec.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 26628c34_830c_3861_c08f_7bc985d595d7["QuicheQuicServerCodec"] 4d83558e_47de_7637_5e6c_b35517175c3d["QuicheQuicServerCodec.java"] 26628c34_830c_3861_c08f_7bc985d595d7 -->|defined in| 4d83558e_47de_7637_5e6c_b35517175c3d 55cd1e4e_d5d5_d375_14b8_a25e2143a9d4["QuicheQuicServerCodec()"] 26628c34_830c_3861_c08f_7bc985d595d7 -->|method| 55cd1e4e_d5d5_d375_14b8_a25e2143a9d4 089f581b_a54f_3046_e318_ceaf87aebd4f["handlerAdded()"] 26628c34_830c_3861_c08f_7bc985d595d7 -->|method| 089f581b_a54f_3046_e318_ceaf87aebd4f 61e53096_0a1c_cf5b_7fa0_ecfbb466d2ea["handlerRemoved()"] 26628c34_830c_3861_c08f_7bc985d595d7 -->|method| 61e53096_0a1c_cf5b_7fa0_ecfbb466d2ea 3fd14bda_c2b1_f7ae_73d2_b81bfad6dafe["QuicheQuicChannel()"] 26628c34_830c_3861_c08f_7bc985d595d7 -->|method| 3fd14bda_c2b1_f7ae_73d2_b81bfad6dafe bf3e0984_0eaf_b19c_c6a6_0da0a3128681["writePacket()"] 26628c34_830c_3861_c08f_7bc985d595d7 -->|method| bf3e0984_0eaf_b19c_c6a6_0da0a3128681 b498d69f_db3c_db90_0c40_ffe28be5c46e["connectQuicChannel()"] 26628c34_830c_3861_c08f_7bc985d595d7 -->|method| b498d69f_db3c_db90_0c40_ffe28be5c46e
Relationship Graph
Source Code
codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicServerCodec.java lines 42–287
final class QuicheQuicServerCodec extends QuicheQuicCodec {
private static final InternalLogger LOGGER = InternalLoggerFactory.getInstance(QuicheQuicServerCodec.class);
private final Function<QuicChannel, ? extends QuicSslEngine> sslEngineProvider;
private final Executor sslTaskExecutor;
private final QuicConnectionIdGenerator connectionIdAddressGenerator;
private final QuicResetTokenGenerator resetTokenGenerator;
private final QuicTokenHandler tokenHandler;
private final ChannelHandler handler;
private final Map.Entry<ChannelOption<?>, Object>[] optionsArray;
private final Map.Entry<AttributeKey<?>, Object>[] attrsArray;
private final ChannelHandler streamHandler;
private final Map.Entry<ChannelOption<?>, Object>[] streamOptionsArray;
private final Map.Entry<AttributeKey<?>, Object>[] streamAttrsArray;
private ByteBuf mintTokenBuffer;
private ByteBuf connIdBuffer;
QuicheQuicServerCodec(QuicheConfig config,
int localConnIdLength,
QuicTokenHandler tokenHandler,
QuicConnectionIdGenerator connectionIdAddressGenerator,
QuicResetTokenGenerator resetTokenGenerator,
FlushStrategy flushStrategy,
Function<QuicChannel, ? extends QuicSslEngine> sslEngineProvider,
Executor sslTaskExecutor,
ChannelHandler handler,
Map.Entry<ChannelOption<?>, Object>[] optionsArray,
Map.Entry<AttributeKey<?>, Object>[] attrsArray,
ChannelHandler streamHandler,
Map.Entry<ChannelOption<?>, Object>[] streamOptionsArray,
Map.Entry<AttributeKey<?>, Object>[] streamAttrsArray) {
super(config, localConnIdLength, flushStrategy);
this.tokenHandler = tokenHandler;
this.connectionIdAddressGenerator = connectionIdAddressGenerator;
this.resetTokenGenerator = resetTokenGenerator;
this.sslEngineProvider = sslEngineProvider;
this.sslTaskExecutor = sslTaskExecutor;
this.handler = handler;
this.optionsArray = optionsArray;
this.attrsArray = attrsArray;
this.streamHandler = streamHandler;
this.streamOptionsArray = streamOptionsArray;
this.streamAttrsArray = streamAttrsArray;
}
@Override
protected void handlerAdded(ChannelHandlerContext ctx, int localConnIdLength) {
connIdBuffer = Quiche.allocateNativeOrder(localConnIdLength);
mintTokenBuffer = Unpooled.directBuffer(tokenHandler.maxTokenLength());
}
@Override
public void handlerRemoved(ChannelHandlerContext ctx) {
super.handlerRemoved(ctx);
if (connIdBuffer != null) {
connIdBuffer.release();
}
if (mintTokenBuffer != null) {
mintTokenBuffer.release();
}
}
@Override
@Nullable
protected QuicheQuicChannel quicPacketRead(ChannelHandlerContext ctx, InetSocketAddress sender,
InetSocketAddress recipient, QuicPacketType type, long version,
ByteBuf scid, ByteBuf dcid, ByteBuf token,
ByteBuf senderSockaddrMemory, ByteBuf recipientSockaddrMemory,
Consumer<QuicheQuicChannel> freeTask, int localConnIdLength,
QuicheConfig config)
throws Exception {
ByteBuffer dcidByteBuffer = dcid.internalNioBuffer(dcid.readerIndex(), dcid.readableBytes());
QuicheQuicChannel channel = getChannel(dcidByteBuffer);
if (channel == null && type == QuicPacketType.INITIAL) {
// We only want to possibility create a new QuicChannel if this is the initial packet, otherwise
// drop the packet on the floor if we did not find a mapping before.
return handleServer(ctx, sender, recipient, type, version, scid, dcid, token,
senderSockaddrMemory, recipientSockaddrMemory, freeTask, localConnIdLength, config);
}
return channel;
}
Source
Frequently Asked Questions
What is the QuicheQuicServerCodec class?
QuicheQuicServerCodec is a class in the netty codebase, defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicServerCodec.java.
Where is QuicheQuicServerCodec defined?
QuicheQuicServerCodec is defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicServerCodec.java at line 42.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free