Interface QuicChannel
- All Superinterfaces:
AttributeMap, Channel, ChannelOutboundInvoker, Comparable<Channel>
-
Nested Class Summary
Nested classes/interfaces inherited from interface Channel
Channel.Unsafe -
Method Summary
Modifier and TypeMethodDescriptiondefault ChannelFuturebind(SocketAddress localAddress) Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFuturebind(SocketAddress localAddress, ChannelPromise promise) Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureclose()Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureClose theQuicChannelclose(boolean applicationClose, int error, ByteBuf reason, ChannelPromise promise) Close theQuicChanneldefault ChannelFutureclose(ChannelPromise promise) Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default Future<QuicConnectionPathStats> collectPathStats(int pathIdx) Collects statistics about the path of the connection and notifies theFutureonce done.collectPathStats(int pathIdx, Promise<QuicConnectionPathStats> promise) Collects statistics about the path of the connection and notifies thePromiseonce done.default Future<QuicConnectionStats> Collects statistics about the connection and notifies theFutureonce done.collectStats(Promise<QuicConnectionStats> promise) Collects statistics about the connection and notifies thePromiseonce done.config()Returns the configuration of this channel.default ChannelFutureconnect(SocketAddress remoteAddress) Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureconnect(SocketAddress remoteAddress, ChannelPromise promise) Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureconnect(SocketAddress remoteAddress, SocketAddress localAddress) Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureconnect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default Future<QuicStreamChannel> createStream(QuicStreamType type, @Nullable ChannelHandler handler) Creates a stream that is using thisQuicChanneland notifies theFutureonce done.createStream(QuicStreamType type, @Nullable ChannelHandler handler, Promise<QuicStreamChannel> promise) Creates a stream that is using thisQuicChanneland notifies thePromiseonce done.default ChannelFutureRequest to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFuturederegister(ChannelPromise promise) Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureRequest to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFuturedisconnect(ChannelPromise promise) Request to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.flush()Request to flush all pending messages via this ChannelOutboundInvoker.booleanReturnstrueif the connection was closed because of idle timeout.@Nullable QuicConnectionAddressReturns the localQuicConnectionAddress.@Nullable SocketAddressReturns the localSocketAddressof the underlying transport that received the data.static QuicChannelBootstrapnewBootstrap(Channel channel) Creates a newQuicChannelBootstrapthat can be used to create and connect newQuicChannels to endpoints using the givenChannelas transport layer.default ChannelFuturenewFailedFuture(Throwable cause) Create a newChannelFuturewhich is marked as failed already.default ChannelProgressivePromiseReturn an newChannelProgressivePromisedefault ChannelPromiseReturn a newChannelPromise.default QuicStreamChannelBootstrapReturns a newQuicStreamChannelBootstrapwhich makes it easy to bootstrap newQuicStreamChannels with custom options and attributes.default ChannelFutureCreate a newChannelFuturewhich is marked as succeeded already.longReturns the number of streams that can be created before stream creation will fail withQuicTransportError.STREAM_LIMIT_ERRORerror.@Nullable QuicTransportParametersReturns theQuicTransportParametersof the peer once received, ornullif not known yet.read()Request to Read data from theChannelinto the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)event if data was read, and triggers achannelReadCompleteevent so the handler can decide to continue reading.@Nullable QuicConnectionAddressReturns the remoteQuicConnectionAddress.@Nullable SocketAddressReturns the remoteSocketAddressof the underlying transport to which the data is sent.@Nullable SSLEngineReturns the usedSSLEngineornullif none is used (yet).default ChannelPromiseReturn a special ChannelPromise which can be reused for different operations.default ChannelFutureRequest to write a message via thisChannelHandlerContextthrough theChannelPipeline.default ChannelFuturewrite(Object msg, ChannelPromise promise) Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.default ChannelFuturewriteAndFlush(Object msg) Shortcut for callChannelOutboundInvoker.write(Object)andChannelOutboundInvoker.flush().default ChannelFuturewriteAndFlush(Object msg, ChannelPromise promise) Shortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)andChannelOutboundInvoker.flush().Methods inherited from interface AttributeMap
attr, hasAttrMethods inherited from interface Channel
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, getOption, id, isActive, isOpen, isRegistered, isWritable, metadata, parent, pipeline, setOption, unsafeMethods inherited from interface Comparable
compareTo
-
Method Details
-
bind
Description copied from interface:ChannelOutboundInvokerRequest to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
bindin interfaceChannel- Specified by:
bindin interfaceChannelOutboundInvoker
-
connect
Description copied from interface:ChannelOutboundInvokerRequest to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.If the connection fails because of a connection timeout, the
ChannelFuturewill get failed with aConnectTimeoutException. If it fails because of connection refused aConnectExceptionwill be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
connectin interfaceChannel- Specified by:
connectin interfaceChannelOutboundInvoker
-
connect
Description copied from interface:ChannelOutboundInvokerRequest to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
connectin interfaceChannel- Specified by:
connectin interfaceChannelOutboundInvoker
-
disconnect
Description copied from interface:ChannelOutboundInvokerRequest to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
disconnectin interfaceChannel- Specified by:
disconnectin interfaceChannelOutboundInvoker
-
close
Description copied from interface:ChannelOutboundInvokerRequest to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. After it is closed it is not possible to reuse it again.This will result in having the
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
closein interfaceChannel- Specified by:
closein interfaceChannelOutboundInvoker
-
deregister
Description copied from interface:ChannelOutboundInvokerRequest to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
deregisterin interfaceChannel- Specified by:
deregisterin interfaceChannelOutboundInvoker
-
bind
Description copied from interface:ChannelOutboundInvokerRequest to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
bindin interfaceChannel- Specified by:
bindin interfaceChannelOutboundInvoker
-
connect
Description copied from interface:ChannelOutboundInvokerRequest to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelFuturewill be notified.If the connection fails because of a connection timeout, the
ChannelFuturewill get failed with aConnectTimeoutException. If it fails because of connection refused aConnectExceptionwill be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
connectin interfaceChannel- Specified by:
connectin interfaceChannelOutboundInvoker
-
connect
default ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) Description copied from interface:ChannelOutboundInvokerRequest to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified and also returned.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
connectin interfaceChannel- Specified by:
connectin interfaceChannelOutboundInvoker
-
disconnect
Description copied from interface:ChannelOutboundInvokerRequest to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
disconnectin interfaceChannel- Specified by:
disconnectin interfaceChannelOutboundInvoker
-
close
Description copied from interface:ChannelOutboundInvokerRequest to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. After it is closed it is not possible to reuse it again. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
closein interfaceChannel- Specified by:
closein interfaceChannelOutboundInvoker
-
deregister
Description copied from interface:ChannelOutboundInvokerRequest to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
deregisterin interfaceChannel- Specified by:
deregisterin interfaceChannelOutboundInvoker
-
write
Description copied from interface:ChannelOutboundInvokerRequest to write a message via thisChannelHandlerContextthrough theChannelPipeline. This method will not request to actual flush, so be sure to callChannelOutboundInvoker.flush()once you want to request to flush all pending data to the actual transport.- Specified by:
writein interfaceChannel- Specified by:
writein interfaceChannelOutboundInvoker
-
write
Description copied from interface:ChannelOutboundInvokerRequest to write a message via thisChannelHandlerContextthrough theChannelPipeline. This method will not request to actual flush, so be sure to callChannelOutboundInvoker.flush()once you want to request to flush all pending data to the actual transport.- Specified by:
writein interfaceChannel- Specified by:
writein interfaceChannelOutboundInvoker
-
writeAndFlush
Description copied from interface:ChannelOutboundInvokerShortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)andChannelOutboundInvoker.flush().- Specified by:
writeAndFlushin interfaceChannel- Specified by:
writeAndFlushin interfaceChannelOutboundInvoker
-
writeAndFlush
Description copied from interface:ChannelOutboundInvokerShortcut for callChannelOutboundInvoker.write(Object)andChannelOutboundInvoker.flush().- Specified by:
writeAndFlushin interfaceChannel- Specified by:
writeAndFlushin interfaceChannelOutboundInvoker
-
newPromise
Description copied from interface:ChannelOutboundInvokerReturn a newChannelPromise.- Specified by:
newPromisein interfaceChannel- Specified by:
newPromisein interfaceChannelOutboundInvoker
-
newProgressivePromise
Description copied from interface:ChannelOutboundInvokerReturn an newChannelProgressivePromise- Specified by:
newProgressivePromisein interfaceChannel- Specified by:
newProgressivePromisein interfaceChannelOutboundInvoker
-
newSucceededFuture
Description copied from interface:ChannelOutboundInvokerCreate a newChannelFuturewhich is marked as succeeded already. SoFuture.isSuccess()will returntrue. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newSucceededFuturein interfaceChannel- Specified by:
newSucceededFuturein interfaceChannelOutboundInvoker
-
newFailedFuture
Description copied from interface:ChannelOutboundInvokerCreate a newChannelFuturewhich is marked as failed already. SoFuture.isSuccess()will returnfalse. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newFailedFuturein interfaceChannel- Specified by:
newFailedFuturein interfaceChannelOutboundInvoker
-
voidPromise
Description copied from interface:ChannelOutboundInvokerReturn a special ChannelPromise which can be reused for different operations.It's only supported to use it for
ChannelOutboundInvoker.write(Object, ChannelPromise).Be aware that the returned
Be aware this is an expert feature and should be used with care!ChannelPromisewill not support most operations and should only be used if you want to save an object allocation for every write operation. You will not be able to detect if the operation was complete, only if it failed as the implementation will callChannelPipeline.fireExceptionCaught(Throwable)in this case.- Specified by:
voidPromisein interfaceChannel- Specified by:
voidPromisein interfaceChannelOutboundInvoker
-
read
QuicChannel read()Description copied from interface:ChannelOutboundInvokerRequest to Read data from theChannelinto the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)event if data was read, and triggers achannelReadCompleteevent so the handler can decide to continue reading. If there's a pending read operation already, this method does nothing.This will result in having the
ChannelOutboundHandler.read(ChannelHandlerContext)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
readin interfaceChannel- Specified by:
readin interfaceChannelOutboundInvoker
-
flush
QuicChannel flush()Description copied from interface:ChannelOutboundInvokerRequest to flush all pending messages via this ChannelOutboundInvoker.- Specified by:
flushin interfaceChannel- Specified by:
flushin interfaceChannelOutboundInvoker
-
config
QuicChannelConfig config()Returns the configuration of this channel. -
sslEngine
-
peerAllowedStreams
Returns the number of streams that can be created before stream creation will fail withQuicTransportError.STREAM_LIMIT_ERRORerror.- Parameters:
type- the stream type.- Returns:
- the number of streams left.
-
isTimedOut
boolean isTimedOut()Returnstrueif the connection was closed because of idle timeout.- Returns:
trueif the connection was closed because of idle timeout,false.
-
peerTransportParameters
Returns theQuicTransportParametersof the peer once received, ornullif not known yet.- Returns:
- peerTransportParams.
-
localAddress
Returns the localQuicConnectionAddress. This address might change over the life-time of the channel.- Specified by:
localAddressin interfaceChannel- Returns:
- local the local
QuicConnectionAddressornullif none is assigned yet, or assigned anymore.
-
remoteAddress
Returns the remoteQuicConnectionAddress. This address might change over the life-time of the channel.- Specified by:
remoteAddressin interfaceChannel- Returns:
- remote the remote
QuicConnectionAddressornullif none is assigned yet, or assigned anymore.
-
localSocketAddress
Returns the localSocketAddressof the underlying transport that received the data. This address might change over the life-time of the channel.- Returns:
- local the local
SocketAddressof the underlying transport ornullif none is assigned yet, or assigned anymore.
-
remoteSocketAddress
Returns the remoteSocketAddressof the underlying transport to which the data is sent. This address might change over the life-time of the channel.- Returns:
- local the remote
SocketAddressof the underlying transport ornullif none is assigned yet, or assigned anymore.
-
createStream
default Future<QuicStreamChannel> createStream(QuicStreamType type, @Nullable @Nullable ChannelHandler handler) Creates a stream that is using thisQuicChanneland notifies theFutureonce done. TheChannelHandler(if notnull) is added to theChannelPipelineof theQuicStreamChannelautomatically.- Parameters:
type- theQuicStreamTypeof theQuicStreamChannel.handler- theChannelHandlerthat will be added to theQuicStreamChannelsChannelPipelineduring the stream creation.- Returns:
- the
Futurethat will be notified once the operation completes.
-
createStream
Future<QuicStreamChannel> createStream(QuicStreamType type, @Nullable @Nullable ChannelHandler handler, Promise<QuicStreamChannel> promise) Creates a stream that is using thisQuicChanneland notifies thePromiseonce done. TheChannelHandler(if notnull) is added to theChannelPipelineof theQuicStreamChannelautomatically.- Parameters:
type- theQuicStreamTypeof theQuicStreamChannel.handler- theChannelHandlerthat will be added to theQuicStreamChannelsChannelPipelineduring the stream creation.promise- theChannelPromisethat will be notified once the operation completes.- Returns:
- the
Futurethat will be notified once the operation completes.
-
newStreamBootstrap
Returns a newQuicStreamChannelBootstrapwhich makes it easy to bootstrap newQuicStreamChannels with custom options and attributes. For simpler use-cases you may want to consider usingcreateStream(QuicStreamType, ChannelHandler)orcreateStream(QuicStreamType, ChannelHandler, Promise)directly.- Returns:
QuicStreamChannelBootstrapthat can be used to bootstrap aQuicStreamChannel.
-
close
Close theQuicChannel- Parameters:
applicationClose-trueif an application close should be used,falseif a normal close should be used.error- the application error number, or0if no special error should be signaled.reason- the reason for the closure (which may be an emptyByteBuf.- Returns:
- the future that is notified.
-
close
Close theQuicChannel- Parameters:
applicationClose-trueif an application close should be used,falseif a normal close should be used.error- the application error number, or0if no special error should be signaled.reason- the reason for the closure (which may be an emptyByteBuf.promise- theChannelPromisethat will be notified.- Returns:
- the future that is notified.
-
collectStats
-
collectStats
Collects statistics about the connection and notifies thePromiseonce done.- Parameters:
promise- theChannelPromisethat is notified once the stats were collected.- Returns:
- the
Futurethat is notified once the stats were collected.
-
collectPathStats
-
collectPathStats
Future<QuicConnectionPathStats> collectPathStats(int pathIdx, Promise<QuicConnectionPathStats> promise) Collects statistics about the path of the connection and notifies thePromiseonce done.- Parameters:
promise- theChannelPromisethat is notified once the stats were collected.- Returns:
- the
Futurethat is notified once the stats were collected.
-
newBootstrap
Creates a newQuicChannelBootstrapthat can be used to create and connect newQuicChannels to endpoints using the givenChannelas transport layer.- Parameters:
channel- theChannelthat is used as transport layer.- Returns:
QuicChannelBootstrapthat can be used to bootstrap a client sideQuicChannel.
-