Package io.netty.handler.codec.quic
Class QuicChannelBootstrap
- java.lang.Object
-
- io.netty.handler.codec.quic.QuicChannelBootstrap
-
public final class QuicChannelBootstrap extends java.lang.Object
Bootstrap that helps to bootstrapQuicChannel
s and connecting these to remote peers.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> QuicChannelBootstrap
attr(AttributeKey<T> key, T value)
Allow to specify an initial attribute of the newly createdQuicChannel
.Future<QuicChannel>
connect()
Connects aQuicChannel
to the remote peer and notifies the future once done.Future<QuicChannel>
connect(Promise<QuicChannel> promise)
Connects aQuicChannel
to the remote peer and notifies the promise once done.QuicChannelBootstrap
connectionAddress(QuicConnectionAddress connectionAddress)
Set theQuicConnectionAddress
to use.QuicChannelBootstrap
handler(ChannelHandler handler)
QuicChannelBootstrap
localAddress(java.net.SocketAddress local)
Set the local address.<T> QuicChannelBootstrap
option(ChannelOption<T> option, T value)
Allow to specify aChannelOption
which is used for theQuicChannel
instances once they got created.QuicChannelBootstrap
remoteAddress(java.net.SocketAddress remote)
Set the remote address of the host to talk to.<T> QuicChannelBootstrap
streamAttr(AttributeKey<T> key, T value)
Allow to specify an initial attribute of the newly createdQuicStreamChannel
.QuicChannelBootstrap
streamHandler(ChannelHandler streamHandler)
<T> QuicChannelBootstrap
streamOption(ChannelOption<T> option, T value)
Allow to specify aChannelOption
which is used for theQuicStreamChannel
instances once they got created.
-
-
-
Method Detail
-
option
public <T> QuicChannelBootstrap option(ChannelOption<T> option, @Nullable T value)
Allow to specify aChannelOption
which is used for theQuicChannel
instances once they got created. Use a value ofnull
to remove a previous setChannelOption
.- Type Parameters:
T
- the type of the value.- Parameters:
option
- theChannelOption
to 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 thevalue
isnull
, the attribute of the specifiedkey
is removed.- Type Parameters:
T
- the type of the value.- Parameters:
key
- theAttributeKey
to apply to theQuicChannel
.value
- the value of the attribute.- Returns:
- this instance.
-
handler
public QuicChannelBootstrap handler(ChannelHandler handler)
- Parameters:
handler
- theChannelHandler
that is added to theQuicChannel
sChannelPipeline
.- Returns:
- this instance.
-
streamOption
public <T> QuicChannelBootstrap streamOption(ChannelOption<T> option, @Nullable T value)
Allow to specify aChannelOption
which is used for theQuicStreamChannel
instances once they got created. Use a value ofnull
to remove a previous setChannelOption
.- Type Parameters:
T
- the type of the value.- Parameters:
option
- theChannelOption
to apply to theQuicStreamChannel
s.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 thevalue
isnull
, the attribute of the specifiedkey
is removed.- Type Parameters:
T
- the type of the value.- Parameters:
key
- theAttributeKey
to apply to theQuicStreamChannel
s.value
- the value of the attribute.- Returns:
- this instance.
-
streamHandler
public QuicChannelBootstrap streamHandler(ChannelHandler streamHandler)
- Parameters:
streamHandler
- theChannelHandler
that is added to theQuicStreamChannel
sChannelPipeline
.- Returns:
- this instance.
-
localAddress
public QuicChannelBootstrap localAddress(java.net.SocketAddress local)
Set the local address.- Parameters:
local
- theSocketAddress
of 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
- theSocketAddress
of the remote peer.- Returns:
- this instance.
-
connectionAddress
public QuicChannelBootstrap connectionAddress(QuicConnectionAddress connectionAddress)
Set theQuicConnectionAddress
to use. If none is specified a random address is generated on your behalf.- Parameters:
connectionAddress
- theQuicConnectionAddress
to use.- Returns:
- this instance.
-
connect
public Future<QuicChannel> connect()
Connects aQuicChannel
to the remote peer and notifies the future once done.- Returns:
Future
which is notified once the operation completes.
-
connect
public Future<QuicChannel> connect(Promise<QuicChannel> promise)
Connects aQuicChannel
to the remote peer and notifies the promise once done.
-
-