Package io.netty.handler.codec.quic
Class QuicChannelBootstrap
- java.lang.Object
-
- io.netty.handler.codec.quic.QuicChannelBootstrap
-
public final class QuicChannelBootstrap extends java.lang.ObjectBootstrap that helps to bootstrapQuicChannels and connecting these to remote peers.
-
-
Constructor Summary
Constructors Constructor Description QuicChannelBootstrap(Channel parent)Deprecated.Use QuicChannel.newBootstrap() instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> QuicChannelBootstrapattr(AttributeKey<T> key, T value)Allow to specify an initial attribute of the newly createdQuicChannel.Future<QuicChannel>connect()Connects aQuicChannelto the remote peer and notifies the future once done.Future<QuicChannel>connect(Promise<QuicChannel> promise)Connects aQuicChannelto the remote peer and notifies the promise once done.QuicChannelBootstrapconnectionAddress(QuicConnectionAddress connectionAddress)Set theQuicConnectionAddressto use.QuicChannelBootstraphandler(ChannelHandler handler)QuicChannelBootstraplocalAddress(java.net.SocketAddress local)Set the local address.<T> QuicChannelBootstrapoption(ChannelOption<T> option, T value)Allow to specify aChannelOptionwhich is used for theQuicChannelinstances once they got created.QuicChannelBootstrapremoteAddress(java.net.SocketAddress remote)Set the remote address of the host to talk to.<T> QuicChannelBootstrapstreamAttr(AttributeKey<T> key, T value)Allow to specify an initial attribute of the newly createdQuicStreamChannel.QuicChannelBootstrapstreamHandler(ChannelHandler streamHandler)<T> QuicChannelBootstrapstreamOption(ChannelOption<T> option, T value)Allow to specify aChannelOptionwhich is used for theQuicStreamChannelinstances once they got created.
-
-
-
Constructor Detail
-
QuicChannelBootstrap
@Deprecated public QuicChannelBootstrap(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(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(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(ChannelHandler handler)
- Parameters:
handler- theChannelHandlerthat is added to theQuicChannelsChannelPipeline.- Returns:
- this instance.
-
streamOption
public <T> QuicChannelBootstrap streamOption(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(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(ChannelHandler streamHandler)
- Parameters:
streamHandler- theChannelHandlerthat is added to theQuicStreamChannelsChannelPipeline.- Returns:
- this instance.
-
localAddress
public QuicChannelBootstrap localAddress(java.net.SocketAddress local)
Set the local address.- Parameters:
local- theSocketAddressof the local peer.- Returns:
- this instance.
-
remoteAddress
public QuicChannelBootstrap remoteAddress(java.net.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 Future<QuicChannel> connect()
Connects aQuicChannelto the remote peer and notifies the future once done.- Returns:
Futurewhich is notified once the operation completes.
-
connect
public Future<QuicChannel> connect(Promise<QuicChannel> promise)
Connects aQuicChannelto the remote peer and notifies the promise once done.
-
-