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 ChannelFutureListener
SHUTDOWN_OUTPUT
Should be added to aChannelFuture
when the output should be cleanly shutdown via aFIN
.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ChannelFuture
bind(java.net.SocketAddress socketAddress)
Request to bind to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.default ChannelFuture
bind(java.net.SocketAddress localAddress, ChannelPromise channelPromise)
Request to bind to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.default ChannelFuture
close()
Request to close theChannel
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.default ChannelFuture
close(ChannelPromise channelPromise)
Request to close theChannel
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.QuicStreamChannelConfig
config()
Returns the configuration of this channel.default ChannelFuture
connect(java.net.SocketAddress remoteAddress)
Request to connect to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.default ChannelFuture
connect(java.net.SocketAddress remoteAddress, ChannelPromise channelPromise)
Request to connect to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.default ChannelFuture
connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
Request to connect to the givenSocketAddress
while bind to the localAddress and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.default ChannelFuture
connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise channelPromise)
Request to connect to the givenSocketAddress
while bind to the localAddress and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.default ChannelFuture
deregister()
Request to deregister from the previous assignedEventExecutor
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.default ChannelFuture
deregister(ChannelPromise channelPromise)
Request to deregister from the previous assignedEventExecutor
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.default ChannelFuture
disconnect()
Request to disconnect from the remote peer and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.default ChannelFuture
disconnect(ChannelPromise channelPromise)
Request to disconnect from the remote peer and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.QuicStreamChannel
flush()
Request to flush all pending messages via this ChannelOutboundInvoker.boolean
isLocalCreated()
Returnstrue
if the stream was created locally.QuicStreamAddress
localAddress()
Returns the local address where this channel is bound to.default ChannelFuture
newFailedFuture(java.lang.Throwable cause)
Create a newChannelFuture
which is marked as failed already.default ChannelProgressivePromise
newProgressivePromise()
Return an newChannelProgressivePromise
default ChannelPromise
newPromise()
Return a newChannelPromise
.default ChannelFuture
newSucceededFuture()
Create a newChannelFuture
which is marked as succeeded already.QuicChannel
parent()
Returns the parent of this channel.@Nullable QuicStreamPriority
priority()
TheQuicStreamPriority
if explicit set for the stream viaupdatePriority(QuicStreamPriority)
orupdatePriority(QuicStreamPriority, ChannelPromise)
.QuicStreamChannel
read()
Request to Read data from theChannel
into the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)
event if data was read, and triggers achannelReadComplete
event so the handler can decide to continue reading.QuicStreamAddress
remoteAddress()
Returns the remote address where this channel is connected to.default ChannelFuture
shutdown()
Will shutdown the input and output sides of this channel.default ChannelFuture
shutdown(int error)
Shortcut for callingshutdownInput(int)
andshutdownInput(int)
.ChannelFuture
shutdown(int error, ChannelPromise promise)
Shortcut for callingshutdownInput(int, ChannelPromise)
andshutdownInput(int, ChannelPromise)
.default ChannelFuture
shutdownInput()
default ChannelFuture
shutdownInput(int error)
Shutdown the input of the stream with the given error code.ChannelFuture
shutdownInput(int error, ChannelPromise promise)
Shutdown the input of the stream with the given error code.default ChannelFuture
shutdownInput(ChannelPromise promise)
Will shutdown the input and notifyChannelPromise
.default ChannelFuture
shutdownOutput()
default ChannelFuture
shutdownOutput(int error)
Shutdown the output of the stream with the given error code.ChannelFuture
shutdownOutput(int error, ChannelPromise promise)
Shutdown the output of the stream with the given error code.long
streamId()
The id of the stream.QuicStreamType
type()
Returns theQuicStreamType
of the stream.default ChannelFuture
updatePriority(QuicStreamPriority priority)
Update the priority of the stream.ChannelFuture
updatePriority(QuicStreamPriority priority, ChannelPromise promise)
Update the priority of the stream.default ChannelPromise
voidPromise()
Return a special ChannelPromise which can be reused for different operations.default ChannelFuture
write(java.lang.Object msg)
Request to write a message via thisChannelHandlerContext
through theChannelPipeline
.default ChannelFuture
write(java.lang.Object msg, ChannelPromise channelPromise)
Request to write a message via thisChannelHandlerContext
through theChannelPipeline
.default ChannelFuture
writeAndFlush(java.lang.Object msg)
Shortcut for callChannelOutboundInvoker.write(Object)
andChannelOutboundInvoker.flush()
.default ChannelFuture
writeAndFlush(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 aChannelFuture
when 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:ChannelOutboundInvoker
Request to bind to the givenSocketAddress
and notify theChannelFuture
once 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 nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
bind
in interfaceChannel
- Specified by:
bind
in interfaceChannelOutboundInvoker
-
connect
default ChannelFuture connect(java.net.SocketAddress remoteAddress)
Description copied from interface:ChannelOutboundInvoker
Request to connect to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.If the connection fails because of a connection timeout, the
ChannelFuture
will get failed with aConnectTimeoutException
. If it fails because of connection refused aConnectException
will be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
connect
in interfaceChannel
- Specified by:
connect
in interfaceChannelOutboundInvoker
-
connect
default ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
Description copied from interface:ChannelOutboundInvoker
Request to connect to the givenSocketAddress
while bind to the localAddress and notify theChannelFuture
once 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 nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
connect
in interfaceChannel
- Specified by:
connect
in interfaceChannelOutboundInvoker
-
disconnect
default ChannelFuture disconnect()
Description copied from interface:ChannelOutboundInvoker
Request to disconnect from the remote peer and notify theChannelFuture
once 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 nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
disconnect
in interfaceChannel
- Specified by:
disconnect
in interfaceChannelOutboundInvoker
-
close
default ChannelFuture close()
Description copied from interface:ChannelOutboundInvoker
Request to close theChannel
and notify theChannelFuture
once 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 nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceChannelOutboundInvoker
-
deregister
default ChannelFuture deregister()
Description copied from interface:ChannelOutboundInvoker
Request to deregister from the previous assignedEventExecutor
and notify theChannelFuture
once 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 nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
deregister
in interfaceChannel
- Specified by:
deregister
in interfaceChannelOutboundInvoker
-
bind
default ChannelFuture bind(java.net.SocketAddress localAddress, ChannelPromise channelPromise)
Description copied from interface:ChannelOutboundInvoker
Request to bind to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelPromise
will be notified.This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
bind
in interfaceChannel
- Specified by:
bind
in interfaceChannelOutboundInvoker
-
connect
default ChannelFuture connect(java.net.SocketAddress remoteAddress, ChannelPromise channelPromise)
Description copied from interface:ChannelOutboundInvoker
Request to connect to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelFuture
will be notified.If the connection fails because of a connection timeout, the
ChannelFuture
will get failed with aConnectTimeoutException
. If it fails because of connection refused aConnectException
will be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
connect
in interfaceChannel
- Specified by:
connect
in interfaceChannelOutboundInvoker
-
connect
default ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise channelPromise)
Description copied from interface:ChannelOutboundInvoker
Request to connect to the givenSocketAddress
while bind to the localAddress and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelPromise
will be notified and also returned.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
connect
in interfaceChannel
- Specified by:
connect
in interfaceChannelOutboundInvoker
-
disconnect
default ChannelFuture disconnect(ChannelPromise channelPromise)
Description copied from interface:ChannelOutboundInvoker
Request to disconnect from the remote peer and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelPromise
will be notified.This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
disconnect
in interfaceChannel
- Specified by:
disconnect
in interfaceChannelOutboundInvoker
-
close
default ChannelFuture close(ChannelPromise channelPromise)
Description copied from interface:ChannelOutboundInvoker
Request to close theChannel
and notify theChannelFuture
once 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 givenChannelPromise
will be notified.This will result in having the
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceChannelOutboundInvoker
-
deregister
default ChannelFuture deregister(ChannelPromise channelPromise)
Description copied from interface:ChannelOutboundInvoker
Request to deregister from the previous assignedEventExecutor
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelPromise
will be notified.This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
deregister
in interfaceChannel
- Specified by:
deregister
in interfaceChannelOutboundInvoker
-
write
default ChannelFuture write(java.lang.Object msg)
Description copied from interface:ChannelOutboundInvoker
Request to write a message via thisChannelHandlerContext
through 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:
write
in interfaceChannel
- Specified by:
write
in interfaceChannelOutboundInvoker
-
write
default ChannelFuture write(java.lang.Object msg, ChannelPromise channelPromise)
Description copied from interface:ChannelOutboundInvoker
Request to write a message via thisChannelHandlerContext
through 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:
write
in interfaceChannel
- Specified by:
write
in interfaceChannelOutboundInvoker
-
writeAndFlush
default ChannelFuture writeAndFlush(java.lang.Object msg, ChannelPromise channelPromise)
Description copied from interface:ChannelOutboundInvoker
Shortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)
andChannelOutboundInvoker.flush()
.- Specified by:
writeAndFlush
in interfaceChannel
- Specified by:
writeAndFlush
in interfaceChannelOutboundInvoker
-
writeAndFlush
default ChannelFuture writeAndFlush(java.lang.Object msg)
Description copied from interface:ChannelOutboundInvoker
Shortcut for callChannelOutboundInvoker.write(Object)
andChannelOutboundInvoker.flush()
.- Specified by:
writeAndFlush
in interfaceChannel
- Specified by:
writeAndFlush
in interfaceChannelOutboundInvoker
-
newPromise
default ChannelPromise newPromise()
Description copied from interface:ChannelOutboundInvoker
Return a newChannelPromise
.- Specified by:
newPromise
in interfaceChannel
- Specified by:
newPromise
in interfaceChannelOutboundInvoker
-
newProgressivePromise
default ChannelProgressivePromise newProgressivePromise()
Description copied from interface:ChannelOutboundInvoker
Return an newChannelProgressivePromise
- Specified by:
newProgressivePromise
in interfaceChannel
- Specified by:
newProgressivePromise
in interfaceChannelOutboundInvoker
-
newSucceededFuture
default ChannelFuture newSucceededFuture()
Description copied from interface:ChannelOutboundInvoker
Create a newChannelFuture
which is marked as succeeded already. SoFuture.isSuccess()
will returntrue
. AllFutureListener
added to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newSucceededFuture
in interfaceChannel
- Specified by:
newSucceededFuture
in interfaceChannelOutboundInvoker
-
newFailedFuture
default ChannelFuture newFailedFuture(java.lang.Throwable cause)
Description copied from interface:ChannelOutboundInvoker
Create a newChannelFuture
which is marked as failed already. SoFuture.isSuccess()
will returnfalse
. AllFutureListener
added to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newFailedFuture
in interfaceChannel
- Specified by:
newFailedFuture
in interfaceChannelOutboundInvoker
-
voidPromise
default ChannelPromise voidPromise()
Description copied from interface:ChannelOutboundInvoker
Return 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!ChannelPromise
will 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:
voidPromise
in interfaceChannel
- Specified by:
voidPromise
in interfaceChannelOutboundInvoker
-
shutdownInput
default ChannelFuture shutdownInput()
- Specified by:
shutdownInput
in interfaceDuplexChannel
- See Also:
Socket.shutdownInput()
-
shutdownInput
default ChannelFuture shutdownInput(ChannelPromise promise)
Description copied from interface:DuplexChannel
Will shutdown the input and notifyChannelPromise
.- Specified by:
shutdownInput
in interfaceDuplexChannel
- See Also:
Socket.shutdownInput()
-
shutdownOutput
default ChannelFuture shutdownOutput()
- Specified by:
shutdownOutput
in interfaceDuplexChannel
- See Also:
Socket.shutdownOutput()
-
shutdown
default ChannelFuture shutdown()
Description copied from interface:DuplexChannel
Will shutdown the input and output sides of this channel.- Specified by:
shutdown
in 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_SENDING
frame will be send to the remote peer and all data received will be discarded.- Parameters:
error
- the error to send as part of theSTOP_SENDING
frame.- 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_SENDING
frame will be send to the remote peer and all data received will be discarded.- Parameters:
error
- the error to send as part of theSTOP_SENDING
frame.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_STREAM
frame 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_STREAM
frame you should useshutdownOutput()
which will shutdown the output by sending aFIN
and so signal a clean shutdown.- Parameters:
error
- the error to send as part of theRESET_STREAM
frame.- 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_STREAM
frame 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_STREAM
frame you should useDuplexChannel.shutdownOutput(ChannelPromise)
which will shutdown the output by sending aFIN
and so signal a clean shutdown.- Parameters:
error
- the error to send as part of theRESET_STREAM
frame.promise
- will be notified on completion.- Returns:
- the future that is notified on completion.
-
localAddress
QuicStreamAddress localAddress()
Description copied from interface:Channel
Returns the local address where this channel is bound to. The returnedSocketAddress
is supposed to be down-cast into more concrete type such asInetSocketAddress
to retrieve the detailed information.- Specified by:
localAddress
in interfaceChannel
- Returns:
- the local address of this channel.
null
if this channel is not bound.
-
remoteAddress
QuicStreamAddress remoteAddress()
Description copied from interface:Channel
Returns the remote address where this channel is connected to. The returnedSocketAddress
is supposed to be down-cast into more concrete type such asInetSocketAddress
to retrieve the detailed information.- Specified by:
remoteAddress
in interfaceChannel
- Returns:
- the remote address of this channel.
null
if 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()
Returnstrue
if the stream was created locally.- Returns:
true
if created locally,false
otherwise.
-
type
QuicStreamType type()
Returns theQuicStreamType
of the stream.- Returns:
QuicStreamType
of this stream.
-
streamId
long streamId()
The id of the stream.- Returns:
- the stream id of this
QuicStreamChannel
.
-
priority
@Nullable @Nullable QuicStreamPriority priority()
TheQuicStreamPriority
if 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:Channel
Returns the parent of this channel.
-
read
QuicStreamChannel read()
Description copied from interface:ChannelOutboundInvoker
Request to Read data from theChannel
into the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)
event if data was read, and triggers achannelReadComplete
event 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 nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
read
in interfaceChannel
- Specified by:
read
in interfaceChannelOutboundInvoker
-
flush
QuicStreamChannel flush()
Description copied from interface:ChannelOutboundInvoker
Request to flush all pending messages via this ChannelOutboundInvoker.- Specified by:
flush
in interfaceChannel
- Specified by:
flush
in interfaceChannelOutboundInvoker
-
config
QuicStreamChannelConfig config()
Description copied from interface:Channel
Returns the configuration of this channel.
-
-