Interface QuicStreamChannel
-
- All Superinterfaces:
AttributeMap,Channel,ChannelOutboundInvoker,java.lang.Comparable<Channel>,DuplexChannel
public interface QuicStreamChannel extends DuplexChannel
A QUIC stream.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.channel.Channel
Channel.Unsafe
-
-
Field Summary
Fields Modifier and Type Field Description static ChannelFutureListenerSHUTDOWN_OUTPUTShould be added to aChannelFuturewhen the output should be cleanly shutdown via aFIN.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ChannelFuturebind(java.net.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(java.net.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.QuicStreamChannelConfigconfig()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 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(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 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 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 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 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 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.QuicStreamChannelflush()Request to flush all pending messages via this ChannelOutboundInvoker.booleanisLocalCreated()Returnstrueif the stream was created locally.QuicStreamAddresslocalAddress()Returns the local address where this channel is bound to.default ChannelFuturenewFailedFuture(java.lang.Throwable cause)Create a newChannelFuturewhich is marked as failed already.default ChannelProgressivePromisenewProgressivePromise()Return an newChannelProgressivePromisedefault ChannelPromisenewPromise()Return a newChannelPromise.default ChannelFuturenewSucceededFuture()Create a newChannelFuturewhich is marked as succeeded already.QuicChannelparent()Returns the parent of this channel.@Nullable QuicStreamPrioritypriority()TheQuicStreamPriorityif explicit set for the stream viaupdatePriority(QuicStreamPriority)orupdatePriority(QuicStreamPriority, ChannelPromise).QuicStreamChannelread()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.QuicStreamAddressremoteAddress()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).ChannelFutureshutdown(int error, ChannelPromise promise)Shortcut for callingshutdownInput(int, ChannelPromise)andshutdownInput(int, ChannelPromise).default ChannelFutureshutdownInput()default ChannelFutureshutdownInput(int error)Shutdown the input of the stream with the given error code.ChannelFutureshutdownInput(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 ChannelFutureshutdownOutput()default ChannelFutureshutdownOutput(int error)Shutdown the output of the stream with the given error code.ChannelFutureshutdownOutput(int error, ChannelPromise promise)Shutdown the output of the stream with the given error code.longstreamId()The id of the stream.QuicStreamTypetype()Returns theQuicStreamTypeof the stream.default ChannelFutureupdatePriority(QuicStreamPriority priority)Update the priority of the stream.ChannelFutureupdatePriority(QuicStreamPriority priority, ChannelPromise promise)Update the priority of the stream.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 channelPromise)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 channelPromise)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, pipeline, setOption, unsafe
-
Methods inherited from interface io.netty.channel.socket.DuplexChannel
isInputShutdown, isOutputShutdown, isShutdown, shutdown, shutdownOutput
-
-
-
-
Field Detail
-
SHUTDOWN_OUTPUT
static final ChannelFutureListener 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 Detail
-
bind
default ChannelFuture bind(java.net.SocketAddress socketAddress)
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 channelPromise)
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 channelPromise)
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 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
default ChannelFuture disconnect(ChannelPromise channelPromise)
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 channelPromise)
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 channelPromise)
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 channelPromise)
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 channelPromise)
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
-
shutdownInput
default ChannelFuture shutdownInput()
- Specified by:
shutdownInputin interfaceDuplexChannel- See Also:
Socket.shutdownInput()
-
shutdownInput
default ChannelFuture shutdownInput(ChannelPromise promise)
Description copied from interface:DuplexChannelWill shutdown the input and notifyChannelPromise.- Specified by:
shutdownInputin interfaceDuplexChannel- See Also:
Socket.shutdownInput()
-
shutdownOutput
default ChannelFuture shutdownOutput()
- Specified by:
shutdownOutputin interfaceDuplexChannel- See Also:
Socket.shutdownOutput()
-
shutdown
default ChannelFuture 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
default ChannelFuture shutdown(int error)
Shortcut for callingshutdownInput(int)andshutdownInput(int).- Parameters:
error- the error to send.- Returns:
- the future that is notified on completion.
-
shutdown
ChannelFuture shutdown(int error, ChannelPromise promise)
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
default ChannelFuture shutdownInput(int error)
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
ChannelFuture shutdownInput(int error, ChannelPromise promise)
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
default ChannelFuture shutdownOutput(int error)
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
ChannelFuture shutdownOutput(int error, ChannelPromise promise)
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
long streamId()
The id of the stream.- Returns:
- the stream id of this
QuicStreamChannel.
-
priority
@Nullable @Nullable QuicStreamPriority priority()
TheQuicStreamPriorityif explicit set for the stream viaupdatePriority(QuicStreamPriority)orupdatePriority(QuicStreamPriority, ChannelPromise). Otherwisenull.- Returns:
- the priority if any was set.
-
updatePriority
default ChannelFuture updatePriority(QuicStreamPriority priority)
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
ChannelFuture updatePriority(QuicStreamPriority priority, ChannelPromise promise)
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
QuicChannel parent()
Description copied from interface:ChannelReturns the parent of this channel.
-
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.
-
-