Class QuicCodecBuilder<B extends QuicCodecBuilder<B>>

java.lang.Object
io.netty.handler.codec.quic.QuicCodecBuilder<B>
Type Parameters:
B - the type of the QuicCodecBuilder.
Direct Known Subclasses:
QuicClientCodecBuilder, QuicServerCodecBuilder

public abstract class QuicCodecBuilder<B extends QuicCodecBuilder<B>> extends Object
Abstract base class for QUIC codec builders.
  • Method Details

    • self

      protected final B self()
      Returns itself.
      Returns:
      itself.
    • flushStrategy

      public final B flushStrategy(FlushStrategy flushStrategy)
      Sets the FlushStrategy that will be used to detect when an automatic flush should happen.
      Parameters:
      flushStrategy - the strategy to use.
      Returns:
      the instance itself.
    • congestionControlAlgorithm

      public final B congestionControlAlgorithm(QuicCongestionControlAlgorithm congestionControlAlgorithm)
      Sets the congestion control algorithm to use. The default is QuicCongestionControlAlgorithm.CUBIC.
      Parameters:
      congestionControlAlgorithm - the QuicCongestionControlAlgorithm to use.
      Returns:
      the instance itself.
    • initialCongestionWindowPackets

      public final B initialCongestionWindowPackets(int numPackets)
      Sets initial congestion window size in terms of packet count. The default value is 10.
      Parameters:
      numPackets - number of packets for the initial congestion window
      Returns:
    • grease

      public final B grease(boolean enable)
      Set if greasing should be enabled or not. The default value is true.
      Parameters:
      enable - true if enabled, false otherwise.
      Returns:
      the instance itself.
    • maxIdleTimeout

      public final B maxIdleTimeout(long amount, TimeUnit unit)
      See set_max_idle_timeout. The default value is infinite, that is, no timeout is used.
      Parameters:
      amount - the maximum idle timeout.
      unit - the TimeUnit.
      Returns:
      the instance itself.
    • maxSendUdpPayloadSize

      public final B maxSendUdpPayloadSize(long size)
      See set_max_send_udp_payload_size. The default and minimum value is 1200.
      Parameters:
      size - the maximum payload size that is advertised to the remote peer.
      Returns:
      the instance itself.
    • maxRecvUdpPayloadSize

      public final B maxRecvUdpPayloadSize(long size)
      See set_max_recv_udp_payload_size. The default value is 65527.
      Parameters:
      size - the maximum payload size that is advertised to the remote peer.
      Returns:
      the instance itself.
    • initialMaxData

      public final B initialMaxData(long value)
      See set_initial_max_data. The default value is 0.
      Parameters:
      value - the initial maximum data limit.
      Returns:
      the instance itself.
    • initialMaxStreamDataBidirectionalLocal

      public final B initialMaxStreamDataBidirectionalLocal(long value)
      See set_initial_max_stream_data_bidi_local. The default value is 0.
      Parameters:
      value - the initial maximum data limit for local bidirectional streams.
      Returns:
      the instance itself.
    • initialMaxStreamDataBidirectionalRemote

      public final B initialMaxStreamDataBidirectionalRemote(long value)
      See set_initial_max_stream_data_bidi_remote. The default value is 0.
      Parameters:
      value - the initial maximum data limit for remote bidirectional streams.
      Returns:
      the instance itself.
    • initialMaxStreamDataUnidirectional

      public final B initialMaxStreamDataUnidirectional(long value)
      See set_initial_max_stream_data_uni. The default value is 0.
      Parameters:
      value - the initial maximum data limit for unidirectional streams.
      Returns:
      the instance itself.
    • initialMaxStreamsBidirectional

      public final B initialMaxStreamsBidirectional(long value)
      See set_initial_max_streams_bidi. The default value is 0.
      Parameters:
      value - the initial maximum stream limit for bidirectional streams.
      Returns:
      the instance itself.
    • initialMaxStreamsUnidirectional

      public final B initialMaxStreamsUnidirectional(long value)
      See set_initial_max_streams_uni. The default value is 0.
      Parameters:
      value - the initial maximum stream limit for unidirectional streams.
      Returns:
      the instance itself.
    • ackDelayExponent

      public final B ackDelayExponent(long value)
      See set_ack_delay_exponent. The default value is 3.
      Parameters:
      value - the delay exponent used for ACKs.
      Returns:
      the instance itself.
    • maxAckDelay

      public final B maxAckDelay(long amount, TimeUnit unit)
      See set_max_ack_delay. The default value is 25 milliseconds.
      Parameters:
      amount - the max ack delay.
      unit - the TimeUnit.
      Returns:
      the instance itself.
    • activeMigration

      public final B activeMigration(boolean enable)
      See set_disable_active_migration. The default value is true.
      Parameters:
      enable - true if migration should be enabled, false otherwise.
      Returns:
      the instance itself.
    • hystart

      public final B hystart(boolean enable)
      See enable_hystart. The default value is true.
      Parameters:
      enable - true if Hystart should be enabled.
      Returns:
      the instance itself.
    • discoverPmtu

      public final B discoverPmtu(boolean enable)
      See discover_pmtu. Configures whether to do path MTU discovery. The default value is false.
      Parameters:
      enable - true if path MTU discovery should be enabled.
      Returns:
      the instance itself.
    • localConnectionIdLength

      public final B localConnectionIdLength(int value)
      Sets the local connection id length that is used. The default is 20, which is also the maximum that is supported.
      Parameters:
      value - the length of local generated connections ids.
      Returns:
      the instance itself.
    • version

      public final B version(int version)
      Allows to configure the QUIC version that should be used. The default value is the latest supported version by the underlying library.
      Parameters:
      version - the QUIC version to use.
      Returns:
      the instance itself.
    • datagram

      public final B datagram(int recvQueueLen, int sendQueueLen)
      If configured this will enable Datagram support.
      Parameters:
      recvQueueLen - the RECV queue length.
      sendQueueLen - the SEND queue length.
      Returns:
      the instance itself.
    • sslContext

      public final B sslContext(QuicSslContext sslContext)
      The QuicSslContext that will be used to create QuicSslEngines for QuicChannels. If you need a more flexible way to provide QuicSslEngines use sslEngineProvider(Function).
      Parameters:
      sslContext - the context.
      Returns:
      the instance itself.
    • sslEngineProvider

      public final B sslEngineProvider(Function<QuicChannel, ? extends QuicSslEngine> sslEngineProvider)
      The Function that will return the QuicSslEngine that should be used for the QuicChannel.
      Parameters:
      sslEngineProvider - the provider.
      Returns:
      the instance itself.
    • sslTaskExecutor

      public final B sslTaskExecutor(Executor sslTaskExecutor)
      Allow to configure a Executor that will be used to run expensive SSL operations.
      Parameters:
      sslTaskExecutor - the Executor that will be used to offload expensive SSL operations.
      Returns:
      the instance itself.
    • activeConnectionIdLimit

      public final B activeConnectionIdLimit(long limit)
      Allows to configure the active connect id limit that should be used.
      Parameters:
      limit - the limit to use.
      Returns:
      the instance itself.
    • statelessResetToken

      public final B statelessResetToken(byte[] token)
      Allows to configure the active connect id limit that should be used.
      Parameters:
      token - the token to use.
      Returns:
      the instance itself.
    • validate

      protected void validate()
      Validate the configuration before building the codec.
    • build

      public final ChannelHandler build()
      Builds the QUIC codec that should be added to the ChannelPipeline of the underlying Channel which is used as transport for QUIC.
      Returns:
      the ChannelHandler which acts as QUIC codec.
    • clone

      public abstract B clone()
      Clone the builder
      Overrides:
      clone in class Object
      Returns:
      the new instance that is a clone if this instance.