Home / Class/ QuicConnectionCloseEvent Class — netty Architecture

QuicConnectionCloseEvent Class — netty Architecture

Architecture documentation for the QuicConnectionCloseEvent class in QuicConnectionCloseEvent.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  073e5661_390d_3ea6_87b0_fe13c3b2ad2e["QuicConnectionCloseEvent"]
  c39cbf7e_e458_e86e_8ac9_bdd02285a516["QuicConnectionCloseEvent.java"]
  073e5661_390d_3ea6_87b0_fe13c3b2ad2e -->|defined in| c39cbf7e_e458_e86e_8ac9_bdd02285a516
  913eaa83_7e11_50c7_0fec_69362629affb["QuicConnectionCloseEvent()"]
  073e5661_390d_3ea6_87b0_fe13c3b2ad2e -->|method| 913eaa83_7e11_50c7_0fec_69362629affb
  fa6c8cd1_0ce0_560d_b488_851ecc1455f8["isApplicationClose()"]
  073e5661_390d_3ea6_87b0_fe13c3b2ad2e -->|method| fa6c8cd1_0ce0_560d_b488_851ecc1455f8
  72dcd09d_6ae4_82da_c642_8644d7d6c963["error()"]
  073e5661_390d_3ea6_87b0_fe13c3b2ad2e -->|method| 72dcd09d_6ae4_82da_c642_8644d7d6c963
  5b15f163_a2bb_4c87_75e1_407d6511b36a["isTlsError()"]
  073e5661_390d_3ea6_87b0_fe13c3b2ad2e -->|method| 5b15f163_a2bb_4c87_75e1_407d6511b36a
  79bff246_09c0_5fef_04ba_010be90a8705["reason()"]
  073e5661_390d_3ea6_87b0_fe13c3b2ad2e -->|method| 79bff246_09c0_5fef_04ba_010be90a8705
  e5111bd7_6efb_40bf_d7bb_13c612e8a482["String()"]
  073e5661_390d_3ea6_87b0_fe13c3b2ad2e -->|method| e5111bd7_6efb_40bf_d7bb_13c612e8a482
  235feed3_733a_8561_3974_1d1912922e33["extractTlsError()"]
  073e5661_390d_3ea6_87b0_fe13c3b2ad2e -->|method| 235feed3_733a_8561_3974_1d1912922e33

Relationship Graph

Source Code

codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicConnectionCloseEvent.java lines 25–96

public final class QuicConnectionCloseEvent implements QuicEvent {

    final boolean applicationClose;
    final int error;
    final byte[] reason;

    QuicConnectionCloseEvent(boolean applicationClose, int error, byte[] reason) {
        this.applicationClose = applicationClose;
        this.error = error;
        this.reason = reason;
    }

    /**
     * Return {@code true} if this was an application close, {@code false} otherwise.
     *
     * @return  if this is an application close.
     */
    public boolean isApplicationClose() {
        return applicationClose;
    }

    /**
     * Return the error that was provided for the close.
     *
     * @return the error.
     */
    public int error() {
        return error;
    }

    /**
     * Returns {@code true} if a <a href="https://www.rfc-editor.org/rfc/rfc9001#section-4.8">TLS error</a>
     * is contained.
     * @return {@code true} if this is an {@code TLS error}, {@code false} otherwise.
     */
    public boolean isTlsError() {
        return !applicationClose && error >= 0x0100;
    }

    /**
     * Returns the reason for the close, which may be empty if no reason was given as part of the close.
     *
     * @return  the reason.
     */
    public byte[] reason() {
        return reason.clone();
    }

    @Override
    public String toString() {
        return "QuicConnectionCloseEvent{" +
                "applicationClose=" + applicationClose +
                ", error=" + error +
                ", reason=" + Arrays.toString(reason) +
                '}';
    }

    /**
     * Extract the contained {@code TLS error} from the {@code QUIC error}. If the given {@code QUIC error} does not
     * contain a {@code TLS error} it will return {@code -1}.
     *
     * @param error the {@code QUIC error}
     * @return      the {@code TLS error} or {@code -1} if there was no {@code TLS error} contained.
     */
    public static int extractTlsError(int error) {
        int tlsError = error - 0x0100;
        if (tlsError < 0) {
            return -1;
        }
        return tlsError;
    }
}

Frequently Asked Questions

What is the QuicConnectionCloseEvent class?
QuicConnectionCloseEvent is a class in the netty codebase, defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicConnectionCloseEvent.java.
Where is QuicConnectionCloseEvent defined?
QuicConnectionCloseEvent is defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicConnectionCloseEvent.java at line 25.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free