Interface QuicChannel
-
- All Superinterfaces:
AttributeMap,Channel,ChannelOutboundInvoker,java.lang.Comparable<Channel>
public interface QuicChannel extends Channel
A QUICChannel.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.channel.Channel
Channel.Unsafe
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ChannelFuturebind(java.net.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(java.net.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(boolean applicationClose, int error, ByteBuf reason)Close theQuicChannelChannelFutureclose(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.Future<QuicConnectionPathStats>collectPathStats(int pathIdx, Promise<QuicConnectionPathStats> promise)Collects statistics about the path of the connection and notifies thePromiseonce done.default Future<QuicConnectionStats>collectStats()Collects statistics about the connection and notifies theFutureonce done.Future<QuicConnectionStats>collectStats(Promise<QuicConnectionStats> promise)Collects statistics about the connection and notifies thePromiseonce done.QuicChannelConfigconfig()Returns the configuration of this channel.default ChannelFutureconnect(java.net.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(java.net.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(java.net.SocketAddress remoteAddress, java.net.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(java.net.SocketAddress remoteAddress, java.net.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.Future<QuicStreamChannel>createStream(QuicStreamType type, @Nullable ChannelHandler handler, Promise<QuicStreamChannel> promise)Creates a stream that is using thisQuicChanneland notifies thePromiseonce done.default ChannelFuturederegister()Request 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 ChannelFuturedisconnect()Request 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.QuicChannelflush()Request to flush all pending messages via this ChannelOutboundInvoker.booleanisTimedOut()Returnstrueif the connection was closed because of idle timeout.@Nullable QuicConnectionAddresslocalAddress()Returns the localQuicConnectionAddress.@Nullable java.net.SocketAddresslocalSocketAddress()Returns 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(java.lang.Throwable cause)Create a newChannelFuturewhich is marked as failed already.default ChannelProgressivePromisenewProgressivePromise()Return an newChannelProgressivePromisedefault ChannelPromisenewPromise()Return a newChannelPromise.default QuicStreamChannelBootstrapnewStreamBootstrap()Returns a newQuicStreamChannelBootstrapwhich makes it easy to bootstrap newQuicStreamChannels with custom options and attributes.default ChannelFuturenewSucceededFuture()Create a newChannelFuturewhich is marked as succeeded already.longpeerAllowedStreams(QuicStreamType type)Returns the number of streams that can be created before stream creation will fail withQuicTransportError.STREAM_LIMIT_ERRORerror.@Nullable QuicTransportParameterspeerTransportParameters()Returns theQuicTransportParametersof the peer once received, ornullif not known yet.QuicChannelread()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 QuicConnectionAddressremoteAddress()Returns the remoteQuicConnectionAddress.@Nullable java.net.SocketAddressremoteSocketAddress()Returns the remoteSocketAddressof the underlying transport to which the data is sent.@Nullable javax.net.ssl.SSLEnginesslEngine()Returns the usedSSLEngineornullif none is used (yet).default ChannelPromisevoidPromise()Return a special ChannelPromise which can be reused for different operations.default ChannelFuturewrite(java.lang.Object msg)Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.default ChannelFuturewrite(java.lang.Object msg, ChannelPromise promise)Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.default ChannelFuturewriteAndFlush(java.lang.Object msg)Shortcut for callChannelOutboundInvoker.write(Object)andChannelOutboundInvoker.flush().default ChannelFuturewriteAndFlush(java.lang.Object msg, ChannelPromise promise)Shortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)andChannelOutboundInvoker.flush().-
Methods inherited from interface io.netty.util.AttributeMap
attr, hasAttr
-
Methods inherited from interface io.netty.channel.Channel
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, getOption, id, isActive, isOpen, isRegistered, isWritable, metadata, parent, pipeline, setOption, unsafe
-
-
-
-
Method Detail
-
bind
default ChannelFuture bind(java.net.SocketAddress localAddress)
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
default ChannelFuture connect(java.net.SocketAddress remoteAddress)
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
default ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
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
default ChannelFuture 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
default ChannelFuture 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
default ChannelFuture 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
default ChannelFuture bind(java.net.SocketAddress localAddress, ChannelPromise promise)
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
default ChannelFuture connect(java.net.SocketAddress remoteAddress, ChannelPromise promise)
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(java.net.SocketAddress remoteAddress, java.net.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
default ChannelFuture disconnect(ChannelPromise promise)
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
default ChannelFuture close(ChannelPromise promise)
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
default ChannelFuture deregister(ChannelPromise promise)
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
default ChannelFuture write(java.lang.Object msg)
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
default ChannelFuture write(java.lang.Object msg, ChannelPromise promise)
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
default ChannelFuture writeAndFlush(java.lang.Object msg, ChannelPromise promise)
Description copied from interface:ChannelOutboundInvokerShortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)andChannelOutboundInvoker.flush().- Specified by:
writeAndFlushin interfaceChannel- Specified by:
writeAndFlushin interfaceChannelOutboundInvoker
-
writeAndFlush
default ChannelFuture writeAndFlush(java.lang.Object msg)
Description copied from interface:ChannelOutboundInvokerShortcut for callChannelOutboundInvoker.write(Object)andChannelOutboundInvoker.flush().- Specified by:
writeAndFlushin interfaceChannel- Specified by:
writeAndFlushin interfaceChannelOutboundInvoker
-
newPromise
default ChannelPromise newPromise()
Description copied from interface:ChannelOutboundInvokerReturn a newChannelPromise.- Specified by:
newPromisein interfaceChannel- Specified by:
newPromisein interfaceChannelOutboundInvoker
-
newProgressivePromise
default ChannelProgressivePromise newProgressivePromise()
Description copied from interface:ChannelOutboundInvokerReturn an newChannelProgressivePromise- Specified by:
newProgressivePromisein interfaceChannel- Specified by:
newProgressivePromisein interfaceChannelOutboundInvoker
-
newSucceededFuture
default ChannelFuture 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
default ChannelFuture newFailedFuture(java.lang.Throwable cause)
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
default ChannelPromise 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
@Nullable @Nullable javax.net.ssl.SSLEngine sslEngine()
Returns the usedSSLEngineornullif none is used (yet).- Returns:
- the engine.
-
peerAllowedStreams
long peerAllowedStreams(QuicStreamType type)
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
@Nullable @Nullable QuicTransportParameters peerTransportParameters()
Returns theQuicTransportParametersof the peer once received, ornullif not known yet.- Returns:
- peerTransportParams.
-
localAddress
@Nullable @Nullable QuicConnectionAddress 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
@Nullable @Nullable QuicConnectionAddress 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
@Nullable @Nullable java.net.SocketAddress 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
@Nullable @Nullable java.net.SocketAddress 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
default QuicStreamChannelBootstrap 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
default ChannelFuture close(boolean applicationClose, int error, ByteBuf reason)
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
ChannelFuture close(boolean applicationClose, int error, ByteBuf reason, ChannelPromise promise)
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
default Future<QuicConnectionStats> collectStats()
Collects statistics about the connection and notifies theFutureonce done.- Returns:
- the
Futurethat is notified once the stats were collected.
-
collectStats
Future<QuicConnectionStats> collectStats(Promise<QuicConnectionStats> promise)
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
default Future<QuicConnectionPathStats> collectPathStats(int pathIdx)
Collects statistics about the path of the connection and notifies theFutureonce done.- Returns:
- the
Futurethat is notified once the stats were collected.
-
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
static QuicChannelBootstrap newBootstrap(Channel channel)
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.
-
-