Package io.netty.handler.codec.quic
Class QuicChannelBootstrap
- java.lang.Object
-
- io.netty.handler.codec.quic.QuicChannelBootstrap
-
public final class QuicChannelBootstrap extends Object
Bootstrap that helps to bootstrapQuicChannels and connecting these to remote peers.
-
-
Constructor Summary
Constructors Constructor Description QuicChannelBootstrap(io.netty.channel.Channel parent)Deprecated.Use QuicChannel.newBootstrap() instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> QuicChannelBootstrapattr(io.netty.util.AttributeKey<T> key, T value)Allow to specify an initial attribute of the newly createdQuicChannel.io.netty.util.concurrent.Future<QuicChannel>connect()Connects aQuicChannelto the remote peer and notifies the future once done.io.netty.util.concurrent.Future<QuicChannel>connect(io.netty.util.concurrent.Promise<QuicChannel> promise)Connects aQuicChannelto the remote peer and notifies the promise once done.QuicChannelBootstrapconnectionAddress(QuicConnectionAddress connectionAddress)Set theQuicConnectionAddressto use.QuicChannelBootstraphandler(io.netty.channel.ChannelHandler handler)QuicChannelBootstraplocalAddress(SocketAddress local)Set the local address.<T> QuicChannelBootstrapoption(io.netty.channel.ChannelOption<T> option, T value)Allow to specify aChannelOptionwhich is used for theQuicChannelinstances once they got created.QuicChannelBootstrapremoteAddress(SocketAddress remote)Set the remote address of the host to talk to.<T> QuicChannelBootstrapstreamAttr(io.netty.util.AttributeKey<T> key, T value)Allow to specify an initial attribute of the newly createdQuicStreamChannel.QuicChannelBootstrapstreamHandler(io.netty.channel.ChannelHandler streamHandler)<T> QuicChannelBootstrapstreamOption(io.netty.channel.ChannelOption<T> option, T value)Allow to specify aChannelOptionwhich is used for theQuicStreamChannelinstances once they got created.
-
-
-
Constructor Detail
-
QuicChannelBootstrap
@Deprecated public QuicChannelBootstrap(io.netty.channel.Channel parent)
Deprecated.Use QuicChannel.newBootstrap() instead.Creates a new instance which uses the givenChannelto bootstrap theQuicChannel. ThisChannelPipelineof theChannelneeds to have the quic codec in the pipeline.- Parameters:
parent- theChannelthat is used as the transport layer.
-
-
Method Detail
-
option
public <T> QuicChannelBootstrap option(io.netty.channel.ChannelOption<T> option, @Nullable T value)
Allow to specify aChannelOptionwhich is used for theQuicChannelinstances once they got created. Use a value ofnullto remove a previous setChannelOption.- Type Parameters:
T- the type of the value.- Parameters:
option- theChannelOptionto apply to theQuicChannel.value- the value of the option.- Returns:
- this instance.
-
attr
public <T> QuicChannelBootstrap attr(io.netty.util.AttributeKey<T> key, @Nullable T value)
Allow to specify an initial attribute of the newly createdQuicChannel. If thevalueisnull, the attribute of the specifiedkeyis removed.- Type Parameters:
T- the type of the value.- Parameters:
key- theAttributeKeyto apply to theQuicChannel.value- the value of the attribute.- Returns:
- this instance.
-
handler
public QuicChannelBootstrap handler(io.netty.channel.ChannelHandler handler)
- Parameters:
handler- theChannelHandlerthat is added to theQuicChannelsChannelPipeline.- Returns:
- this instance.
-
streamOption
public <T> QuicChannelBootstrap streamOption(io.netty.channel.ChannelOption<T> option, @Nullable T value)
Allow to specify aChannelOptionwhich is used for theQuicStreamChannelinstances once they got created. Use a value ofnullto remove a previous setChannelOption.- Type Parameters:
T- the type of the value.- Parameters:
option- theChannelOptionto apply to theQuicStreamChannels.value- the value of the option.- Returns:
- this instance.
-
streamAttr
public <T> QuicChannelBootstrap streamAttr(io.netty.util.AttributeKey<T> key, @Nullable T value)
Allow to specify an initial attribute of the newly createdQuicStreamChannel. If thevalueisnull, the attribute of the specifiedkeyis removed.- Type Parameters:
T- the type of the value.- Parameters:
key- theAttributeKeyto apply to theQuicStreamChannels.value- the value of the attribute.- Returns:
- this instance.
-
streamHandler
public QuicChannelBootstrap streamHandler(io.netty.channel.ChannelHandler streamHandler)
- Parameters:
streamHandler- theChannelHandlerthat is added to theQuicStreamChannelsChannelPipeline.- Returns:
- this instance.
-
localAddress
public QuicChannelBootstrap localAddress(SocketAddress local)
Set the local address.- Parameters:
local- theSocketAddressof the local peer.- Returns:
- this instance.
-
remoteAddress
public QuicChannelBootstrap remoteAddress(SocketAddress remote)
Set the remote address of the host to talk to.- Parameters:
remote- theSocketAddressof the remote peer.- Returns:
- this instance.
-
connectionAddress
public QuicChannelBootstrap connectionAddress(QuicConnectionAddress connectionAddress)
Set theQuicConnectionAddressto use. If none is specified a random address is generated on your behalf.- Parameters:
connectionAddress- theQuicConnectionAddressto use.- Returns:
- this instance.
-
connect
public io.netty.util.concurrent.Future<QuicChannel> connect()
Connects aQuicChannelto the remote peer and notifies the future once done.- Returns:
Futurewhich is notified once the operation completes.
-
connect
public io.netty.util.concurrent.Future<QuicChannel> connect(io.netty.util.concurrent.Promise<QuicChannel> promise)
Connects aQuicChannelto the remote peer and notifies the promise once done.- Parameters:
promise- thePromisewhich is notified once the operations completes.- Returns:
Futurewhich is notified once the operation completes.
-
-