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 java.lang.Object
Abstract base class forQUIC
codec builders.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description B
ackDelayExponent(long value)
B
activeConnectionIdLimit(long limit)
Allows to configure theactive connect id limit
that should be used.B
activeMigration(boolean enable)
ChannelHandler
build()
Builds the QUIC codec that should be added to theChannelPipeline
of the underlyingChannel
which is used as transport for QUIC.abstract B
clone()
Clone the builderB
congestionControlAlgorithm(QuicCongestionControlAlgorithm congestionControlAlgorithm)
Sets the congestion control algorithm to use.B
datagram(int recvQueueLen, int sendQueueLen)
If configured this will enable Datagram support.B
flushStrategy(FlushStrategy flushStrategy)
Sets theFlushStrategy
that will be used to detect when an automatic flush should happen.B
grease(boolean enable)
Set if greasing should be enabled or not.B
hystart(boolean enable)
See enable_hystart.B
initialCongestionWindowPackets(int numPackets)
Sets initial congestion window size in terms of packet count.B
initialMaxData(long value)
See set_initial_max_data.B
initialMaxStreamDataBidirectionalLocal(long value)
B
initialMaxStreamDataBidirectionalRemote(long value)
B
initialMaxStreamDataUnidirectional(long value)
B
initialMaxStreamsBidirectional(long value)
B
initialMaxStreamsUnidirectional(long value)
B
localConnectionIdLength(int value)
Sets the local connection id length that is used.B
maxAckDelay(long amount, java.util.concurrent.TimeUnit unit)
See set_max_ack_delay.B
maxIdleTimeout(long amount, java.util.concurrent.TimeUnit unit)
See set_max_idle_timeout.B
maxRecvUdpPayloadSize(long size)
B
maxSendUdpPayloadSize(long size)
protected B
self()
Returns itself.B
sslContext(QuicSslContext sslContext)
B
sslEngineProvider(java.util.function.Function<QuicChannel,? extends QuicSslEngine> sslEngineProvider)
B
sslTaskExecutor(java.util.concurrent.Executor sslTaskExecutor)
Allow to configure aExecutor
that will be used to run expensive SSL operations.B
statelessResetToken(byte[] token)
Allows to configure theactive connect id limit
that should be used.protected void
validate()
Validate the configuration before building the codec.B
version(int version)
Allows to configure theQUIC version
that should be used.
-
-
-
Method Detail
-
self
protected final B self()
Returns itself.- Returns:
- itself.
-
flushStrategy
public final B flushStrategy(FlushStrategy flushStrategy)
Sets theFlushStrategy
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 isQuicCongestionControlAlgorithm.CUBIC
.- Parameters:
congestionControlAlgorithm
- theQuicCongestionControlAlgorithm
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 istrue
.- Parameters:
enable
-true
if enabled,false
otherwise.- Returns:
- the instance itself.
-
maxIdleTimeout
public final B maxIdleTimeout(long amount, java.util.concurrent.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, java.util.concurrent.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
-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 istrue
.- Parameters:
enable
-true
if Hystart 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 version
that should be used. The default value is the latest supported version by the underlying library.- Parameters:
version
- theQUIC 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)
TheQuicSslContext
that will be used to createQuicSslEngine
s forQuicChannel
s. If you need a more flexible way to provideQuicSslEngine
s usesslEngineProvider(Function)
.- Parameters:
sslContext
- the context.- Returns:
- the instance itself.
-
sslEngineProvider
public final B sslEngineProvider(java.util.function.Function<QuicChannel,? extends QuicSslEngine> sslEngineProvider)
- Parameters:
sslEngineProvider
- the provider.- Returns:
- the instance itself.
-
sslTaskExecutor
public final B sslTaskExecutor(java.util.concurrent.Executor sslTaskExecutor)
Allow to configure aExecutor
that will be used to run expensive SSL operations.- Parameters:
sslTaskExecutor
- theExecutor
that 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 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 theactive 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 theChannelPipeline
of the underlyingChannel
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 classjava.lang.Object
- Returns:
- the new instance that is a clone if this instance.
-
-