Interface QuicStreamChannel
- All Superinterfaces:
AttributeMap, Channel, ChannelOutboundInvoker, Comparable<Channel>, DuplexChannel
-
Nested Class Summary
Nested classes/interfaces inherited from interface Channel
Channel.Unsafe -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ChannelFutureListenerShould be added to aChannelFuturewhen the output should be cleanly shutdown via aFIN. -
Method Summary
Modifier and TypeMethodDescriptiondefault ChannelFuturebind(SocketAddress socketAddress) 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 channelPromise) 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(ChannelPromise channelPromise) Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.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 channelPromise) 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 channelPromise) 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 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 channelPromise) 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 channelPromise) 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 stream was created locally.Returns the local address where this channel is bound to.default ChannelFuturenewFailedFuture(Throwable cause) Create a newChannelFuturewhich is marked as failed already.default ChannelProgressivePromiseReturn an newChannelProgressivePromisedefault ChannelPromiseReturn a newChannelPromise.default ChannelFutureCreate a newChannelFuturewhich is marked as succeeded already.parent()Returns the parent of this channel.@Nullable QuicStreamPrioritypriority()TheQuicStreamPriorityif explicit set for the stream viaupdatePriority(QuicStreamPriority)orupdatePriority(QuicStreamPriority, ChannelPromise).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.Returns the remote address where this channel is connected to.default ChannelFutureshutdown()Will shutdown the input and output sides of this channel.default ChannelFutureshutdown(int error) Shortcut for callingshutdownInput(int)andshutdownInput(int).shutdown(int error, ChannelPromise promise) Shortcut for callingshutdownInput(int, ChannelPromise)andshutdownInput(int, ChannelPromise).default ChannelFuturedefault ChannelFutureshutdownInput(int error) Shutdown the input of the stream with the given error code.shutdownInput(int error, ChannelPromise promise) Shutdown the input of the stream with the given error code.default ChannelFutureshutdownInput(ChannelPromise promise) Will shutdown the input and notifyChannelPromise.default ChannelFuturedefault ChannelFutureshutdownOutput(int error) Shutdown the output of the stream with the given error code.shutdownOutput(int error, ChannelPromise promise) Shutdown the output of the stream with the given error code.longstreamId()The id of the stream.type()Returns theQuicStreamTypeof the stream.default ChannelFutureupdatePriority(QuicStreamPriority priority) Update the priority of the stream.updatePriority(QuicStreamPriority priority, ChannelPromise promise) Update the priority of the stream.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 channelPromise) Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.default ChannelFuturewriteAndFlush(Object msg) Shortcut for callChannelOutboundInvoker.write(Object)andChannelOutboundInvoker.flush().default ChannelFuturewriteAndFlush(Object msg, ChannelPromise channelPromise) 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, pipeline, setOption, unsafeMethods inherited from interface Comparable
compareToMethods inherited from interface DuplexChannel
isInputShutdown, isOutputShutdown, isShutdown, shutdown, shutdownOutput
-
Field Details
-
SHUTDOWN_OUTPUT
Should be added to aChannelFuturewhen the output should be cleanly shutdown via aFIN. No more writes will be allowed after this point.
-
-
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 channelPromise) 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
-
shutdownInput
- Specified by:
shutdownInputin interfaceDuplexChannel- See Also:
-
shutdownInput
Description copied from interface:DuplexChannelWill shutdown the input and notifyChannelPromise.- Specified by:
shutdownInputin interfaceDuplexChannel- See Also:
-
shutdownOutput
- Specified by:
shutdownOutputin interfaceDuplexChannel- See Also:
-
shutdown
Description copied from interface:DuplexChannelWill shutdown the input and output sides of this channel.- Specified by:
shutdownin interfaceDuplexChannel- Returns:
- will be completed when both shutdown operations complete.
-
shutdown
Shortcut for callingshutdownInput(int)andshutdownInput(int).- Parameters:
error- the error to send.- Returns:
- the future that is notified on completion.
-
shutdown
Shortcut for callingshutdownInput(int, ChannelPromise)andshutdownInput(int, ChannelPromise).- Parameters:
error- the error to send.promise- will be notified on completion.- Returns:
- the future that is notified on completion.
-
shutdownInput
Shutdown the input of the stream with the given error code. This means aSTOP_SENDINGframe will be send to the remote peer and all data received will be discarded.- Parameters:
error- the error to send as part of theSTOP_SENDINGframe.- Returns:
- the future that is notified on completion.
-
shutdownInput
Shutdown the input of the stream with the given error code. This means aSTOP_SENDINGframe will be send to the remote peer and all data received will be discarded.- Parameters:
error- the error to send as part of theSTOP_SENDINGframe.promise- will be notified on completion.- Returns:
- the future that is notified on completion.
-
shutdownOutput
Shutdown the output of the stream with the given error code. This means aRESET_STREAMframe will be send to the remote peer and all data that is not sent yet will be discarded. Important:If you want to shutdown the output without sending aRESET_STREAMframe you should useshutdownOutput()which will shutdown the output by sending aFINand so signal a clean shutdown.- Parameters:
error- the error to send as part of theRESET_STREAMframe.- Returns:
- the future that is notified on completion.
-
shutdownOutput
Shutdown the output of the stream with the given error code. This means aRESET_STREAMframe will be send to the remote peer and all data that is not sent yet will be discarded. Important:If you want to shutdown the output without sending aRESET_STREAMframe you should useDuplexChannel.shutdownOutput(ChannelPromise)which will shutdown the output by sending aFINand so signal a clean shutdown.- Parameters:
error- the error to send as part of theRESET_STREAMframe.promise- will be notified on completion.- Returns:
- the future that is notified on completion.
-
localAddress
QuicStreamAddress localAddress()Description copied from interface:ChannelReturns the local address where this channel is bound to. The returnedSocketAddressis supposed to be down-cast into more concrete type such asInetSocketAddressto retrieve the detailed information.- Specified by:
localAddressin interfaceChannel- Returns:
- the local address of this channel.
nullif this channel is not bound.
-
remoteAddress
QuicStreamAddress remoteAddress()Description copied from interface:ChannelReturns the remote address where this channel is connected to. The returnedSocketAddressis supposed to be down-cast into more concrete type such asInetSocketAddressto retrieve the detailed information.- Specified by:
remoteAddressin interfaceChannel- Returns:
- the remote address of this channel.
nullif this channel is not connected. If this channel is not connected but it can receive messages from arbitrary remote addresses (e.g.DatagramChannel, useDefaultAddressedEnvelope.recipient()to determine the origination of the received message as this method will returnnull.
-
isLocalCreated
boolean isLocalCreated()Returnstrueif the stream was created locally.- Returns:
trueif created locally,falseotherwise.
-
type
QuicStreamType type()Returns theQuicStreamTypeof the stream.- Returns:
QuicStreamTypeof this stream.
-
streamId
-
priority
TheQuicStreamPriorityif explicit set for the stream viaupdatePriority(QuicStreamPriority)orupdatePriority(QuicStreamPriority, ChannelPromise). Otherwisenull.- Returns:
- the priority if any was set.
-
updatePriority
Update the priority of the stream. A stream's priority determines the order in which stream data is sent on the wire (streams with lower priority are sent first).- Parameters:
priority- the priority.- Returns:
- future that is notified once the operation completes.
-
updatePriority
Update the priority of the stream. A stream's priority determines the order in which stream data is sent on the wire (streams with lower priority are sent first).- Parameters:
priority- the priority.promise- notified once operations completes.- Returns:
- future that is notified once the operation completes.
-
parent
-
read
QuicStreamChannel 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
QuicStreamChannel flush()Description copied from interface:ChannelOutboundInvokerRequest to flush all pending messages via this ChannelOutboundInvoker.- Specified by:
flushin interfaceChannel- Specified by:
flushin interfaceChannelOutboundInvoker
-
config
QuicStreamChannelConfig config()Description copied from interface:ChannelReturns the configuration of this channel.
-