Package io.netty.handler.codec.quic
Class QuicCodecBuilder<B extends QuicCodecBuilder<B>>
- java.lang.Object
-
- io.netty.handler.codec.quic.QuicCodecBuilder<B>
-
- Type Parameters:
B- the type of theQuicCodecBuilder.
- Direct Known Subclasses:
QuicClientCodecBuilder,QuicServerCodecBuilder
public abstract class QuicCodecBuilder<B extends QuicCodecBuilder<B>> extends Object
Abstract base class forQUICcodec builders.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BackDelayExponent(long value)BactiveConnectionIdLimit(long limit)Allows to configure theactive connect id limitthat should be used.BactiveMigration(boolean enable)io.netty.channel.ChannelHandlerbuild()Builds the QUIC codec that should be added to theChannelPipelineof the underlyingChannelwhich is used as transport for QUIC.abstract Bclone()Clone the builderBcongestionControlAlgorithm(QuicCongestionControlAlgorithm congestionControlAlgorithm)Sets the congestion control algorithm to use.Bdatagram(int recvQueueLen, int sendQueueLen)If configured this will enable Datagram support.BdiscoverPmtu(boolean enable)See discover_pmtu.BflushStrategy(FlushStrategy flushStrategy)Sets theFlushStrategythat will be used to detect when an automatic flush should happen.Bgrease(boolean enable)Set if greasing should be enabled or not.Bhystart(boolean enable)See enable_hystart.BinitialCongestionWindowPackets(int numPackets)Sets initial congestion window size in terms of packet count.BinitialMaxData(long value)See set_initial_max_data.BinitialMaxStreamDataBidirectionalLocal(long value)BinitialMaxStreamDataBidirectionalRemote(long value)BinitialMaxStreamDataUnidirectional(long value)BinitialMaxStreamsBidirectional(long value)BinitialMaxStreamsUnidirectional(long value)BlocalConnectionIdLength(int value)Sets the local connection id length that is used.BmaxAckDelay(long amount, TimeUnit unit)See set_max_ack_delay.BmaxIdleTimeout(long amount, TimeUnit unit)See set_max_idle_timeout.BmaxRecvUdpPayloadSize(long size)BmaxSendUdpPayloadSize(long size)protected Bself()Returns itself.BsslContext(QuicSslContext sslContext)BsslEngineProvider(Function<QuicChannel,? extends QuicSslEngine> sslEngineProvider)BsslTaskExecutor(Executor sslTaskExecutor)Allow to configure aExecutorthat will be used to run expensive SSL operations.BstatelessResetToken(byte[] token)Allows to configure theactive connect id limitthat should be used.protected voidvalidate()Validate the configuration before building the codec.Bversion(int version)Allows to configure theQUIC versionthat should be used.
-
-
-
Method Detail
-
self
protected final B self()
Returns itself.- Returns:
- itself.
-
flushStrategy
public final B flushStrategy(FlushStrategy flushStrategy)
Sets theFlushStrategythat 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 isQuicCongestionControlAlgorithm.CUBIC.- Parameters:
congestionControlAlgorithm- theQuicCongestionControlAlgorithmto 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 istrue.- Parameters:
enable-trueif enabled,falseotherwise.- 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- theTimeUnit.- 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- theTimeUnit.- Returns:
- the instance itself.
-
activeMigration
public final B activeMigration(boolean enable)
See set_disable_active_migration. The default value istrue.- Parameters:
enable-trueif migration should be enabled,falseotherwise.- Returns:
- the instance itself.
-
hystart
public final B hystart(boolean enable)
See enable_hystart. The default value istrue.- Parameters:
enable-trueif 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 isfalse.- Parameters:
enable-trueif 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 theQUIC versionthat should be used. The default value is the latest supported version by the underlying library.- Parameters:
version- theQUIC versionto 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)
TheQuicSslContextthat will be used to createQuicSslEngines forQuicChannels. If you need a more flexible way to provideQuicSslEngines usesslEngineProvider(Function).- Parameters:
sslContext- the context.- Returns:
- the instance itself.
-
sslEngineProvider
public final B sslEngineProvider(Function<QuicChannel,? extends QuicSslEngine> sslEngineProvider)
- Parameters:
sslEngineProvider- the provider.- Returns:
- the instance itself.
-
sslTaskExecutor
public final B sslTaskExecutor(Executor sslTaskExecutor)
Allow to configure aExecutorthat will be used to run expensive SSL operations.- Parameters:
sslTaskExecutor- theExecutorthat will be used to offload expensive SSL operations.- Returns:
- the instance itself.
-
activeConnectionIdLimit
public final B activeConnectionIdLimit(long limit)
Allows to configure theactive connect id limitthat should be used.- Parameters:
limit- the limit to use.- Returns:
- the instance itself.
-
statelessResetToken
public final B statelessResetToken(byte[] token)
Allows to configure theactive connect id limitthat 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 io.netty.channel.ChannelHandler build()
Builds the QUIC codec that should be added to theChannelPipelineof the underlyingChannelwhich is used as transport for QUIC.- Returns:
- the
ChannelHandlerwhich acts as QUIC codec.
-
-