QuicConnectionAddress Class — netty Architecture
Architecture documentation for the QuicConnectionAddress class in QuicConnectionAddress.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD c1f8932f_a78c_baa9_1579_f1facbc25520["QuicConnectionAddress"] 11c63a46_37a7_c07c_eac4_279eaa773777["QuicConnectionAddress.java"] c1f8932f_a78c_baa9_1579_f1facbc25520 -->|defined in| 11c63a46_37a7_c07c_eac4_279eaa773777 60ce1e5a_9bc4_6053_74e9_0d8201b828a5["QuicConnectionAddress()"] c1f8932f_a78c_baa9_1579_f1facbc25520 -->|method| 60ce1e5a_9bc4_6053_74e9_0d8201b828a5 76da92ff_7593_bf65_a07f_4858bc8b13b4["String()"] c1f8932f_a78c_baa9_1579_f1facbc25520 -->|method| 76da92ff_7593_bf65_a07f_4858bc8b13b4 235c35da_f3b7_a02f_e22c_c0685aeebb31["hashCode()"] c1f8932f_a78c_baa9_1579_f1facbc25520 -->|method| 235c35da_f3b7_a02f_e22c_c0685aeebb31 37fc8c47_4fa8_1767_c92c_b787202a6b64["equals()"] c1f8932f_a78c_baa9_1579_f1facbc25520 -->|method| 37fc8c47_4fa8_1767_c92c_b787202a6b64 f268c609_eaf7_52e9_9d69_d84ed2989912["ByteBuffer()"] c1f8932f_a78c_baa9_1579_f1facbc25520 -->|method| f268c609_eaf7_52e9_9d69_d84ed2989912
Relationship Graph
Source Code
codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicConnectionAddress.java lines 30–135
public final class QuicConnectionAddress extends SocketAddress {
static final QuicConnectionAddress NULL_LEN = new QuicConnectionAddress(EmptyArrays.EMPTY_BYTES);
/**
* Special {@link QuicConnectionAddress} that should be used when the connection address should be generated
* and chosen on the fly.
*/
public static final QuicConnectionAddress EPHEMERAL = new QuicConnectionAddress(null, false);
private final String toStr;
private final ByteBuffer connId;
/**
* Create a new instance
*
* @param connId the connection id to use.
*/
public QuicConnectionAddress(byte[] connId) {
this(ByteBuffer.wrap(connId.clone()), true);
}
/**
* Create a new instance
*
* @param connId the connection id to use.
*/
public QuicConnectionAddress(ByteBuffer connId) {
this(connId.duplicate(), true);
}
private QuicConnectionAddress(ByteBuffer connId, boolean validate) {
Quic.ensureAvailability();
if (validate && connId.remaining() > Quiche.QUICHE_MAX_CONN_ID_LEN) {
throw new IllegalArgumentException("Connection ID can only be of max length "
+ Quiche.QUICHE_MAX_CONN_ID_LEN);
}
if (connId == null) {
this.connId = null;
toStr = "QuicConnectionAddress{EPHEMERAL}";
} else {
this.connId = connId.asReadOnlyBuffer().duplicate();
ByteBuf buffer = Unpooled.wrappedBuffer(connId);
try {
toStr = "QuicConnectionAddress{" +
"connId=" + ByteBufUtil.hexDump(buffer) + '}';
} finally {
buffer.release();
}
}
}
@Override
public String toString() {
return toStr;
}
@Override
public int hashCode() {
if (this == EPHEMERAL) {
return System.identityHashCode(EPHEMERAL);
}
return Objects.hash(connId);
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof QuicConnectionAddress)) {
return false;
}
QuicConnectionAddress address = (QuicConnectionAddress) obj;
if (obj == this) {
return true;
}
return connId.equals(address.connId);
}
ByteBuffer id() {
if (connId == null) {
return ByteBuffer.allocate(0);
Source
Frequently Asked Questions
What is the QuicConnectionAddress class?
QuicConnectionAddress is a class in the netty codebase, defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicConnectionAddress.java.
Where is QuicConnectionAddress defined?
QuicConnectionAddress is defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicConnectionAddress.java at line 30.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free