Package io.netty.handler.codec.http2
Class AbstractHttp2StreamChannel.Http2ChannelUnsafe
java.lang.Object
io.netty.handler.codec.http2.AbstractHttp2StreamChannel.Http2ChannelUnsafe
- All Implemented Interfaces:
Channel.Unsafe
- Enclosing class:
AbstractHttp2StreamChannel
private final class AbstractHttp2StreamChannel.Http2ChannelUnsafe
extends Object
implements Channel.Unsafe
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private boolean
private RecvByteBufAllocator.Handle
private final VoidChannelPromise
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Schedules a read operation that fills the inbound buffer of the firstChannelInboundHandler
in theChannelPipeline
.void
bind
(SocketAddress localAddress, ChannelPromise promise) void
close
(ChannelPromise promise) Close theChannel
of theChannelPromise
and notify theChannelPromise
once the operation was complete.(package private) void
close
(ChannelPromise promise, Http2Error error) void
Closes theChannel
immediately without firing any events.void
connect
(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) void
deregister
(ChannelPromise promise) Deregister theChannel
of theChannelPromise
fromEventLoop
and notify theChannelPromise
once the operation was complete.void
disconnect
(ChannelPromise promise) Disconnect theChannel
of theChannelFuture
and notify theChannelPromise
once the operation was complete.(package private) void
(package private) void
doRead0
(Http2Frame frame, RecvByteBufAllocator.Handle allocHandle) private void
fireChannelInactiveAndDeregister
(ChannelPromise promise, boolean fireChannelInactive) private void
firstWriteComplete
(ChannelFuture future, ChannelPromise promise) void
flush()
Flush out all write operations scheduled viaChannel.Unsafe.write(Object, ChannelPromise)
.private void
invokeLater
(Runnable task) Return theSocketAddress
to which is bound local ornull
if none.(package private) void
notifyReadComplete
(RecvByteBufAllocator.Handle allocHandle, boolean forceReadComplete, boolean inReadLoop) Returns theChannelOutboundBuffer
of theChannel
where the pending write requests are stored.private Object
(package private) void
readEOS()
Return the assignedRecvByteBufAllocator.Handle
which will be used to allocateByteBuf
's when receiving data.void
register
(EventLoop eventLoop, ChannelPromise promise) Register theChannel
of theChannelPromise
and notify theChannelFuture
once the registration was complete.Return theSocketAddress
to which is bound remote ornull
if none is bound yet.private void
private void
safeSetSuccess
(ChannelPromise promise) private void
private Http2StreamFrame
Return a special ChannelPromise which can be reused and passed to the operations inChannel.Unsafe
.private Throwable
wrapStreamClosedError
(Throwable cause) void
write
(Object msg, ChannelPromise promise) Schedules a write operation.private void
writeComplete
(ChannelFuture future, ChannelPromise promise) private void
writeHttp2StreamFrame
(Http2StreamFrame frame, ChannelPromise promise)
-
Field Details
-
unsafeVoidPromise
-
recvHandle
-
writeDoneAndNoFlush
private boolean writeDoneAndNoFlush -
closeInitiated
private boolean closeInitiated -
readEOS
private boolean readEOS
-
-
Constructor Details
-
Http2ChannelUnsafe
private Http2ChannelUnsafe()
-
-
Method Details
-
connect
public void connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) Description copied from interface:Channel.Unsafe
Connect theChannel
of the givenChannelFuture
with the given remoteSocketAddress
. If a specific localSocketAddress
should be used it need to be given as argument. Otherwise just passnull
to it. TheChannelPromise
will get notified once the connect operation was complete.- Specified by:
connect
in interfaceChannel.Unsafe
-
recvBufAllocHandle
Description copied from interface:Channel.Unsafe
Return the assignedRecvByteBufAllocator.Handle
which will be used to allocateByteBuf
's when receiving data.- Specified by:
recvBufAllocHandle
in interfaceChannel.Unsafe
-
localAddress
Description copied from interface:Channel.Unsafe
Return theSocketAddress
to which is bound local ornull
if none.- Specified by:
localAddress
in interfaceChannel.Unsafe
-
remoteAddress
Description copied from interface:Channel.Unsafe
Return theSocketAddress
to which is bound remote ornull
if none is bound yet.- Specified by:
remoteAddress
in interfaceChannel.Unsafe
-
register
Description copied from interface:Channel.Unsafe
Register theChannel
of theChannelPromise
and notify theChannelFuture
once the registration was complete.- Specified by:
register
in interfaceChannel.Unsafe
-
bind
Description copied from interface:Channel.Unsafe
- Specified by:
bind
in interfaceChannel.Unsafe
-
disconnect
Description copied from interface:Channel.Unsafe
Disconnect theChannel
of theChannelFuture
and notify theChannelPromise
once the operation was complete.- Specified by:
disconnect
in interfaceChannel.Unsafe
-
close
Description copied from interface:Channel.Unsafe
Close theChannel
of theChannelPromise
and notify theChannelPromise
once the operation was complete.- Specified by:
close
in interfaceChannel.Unsafe
-
close
-
closeForcibly
public void closeForcibly()Description copied from interface:Channel.Unsafe
Closes theChannel
immediately without firing any events. Probably only useful when registration attempt failed.- Specified by:
closeForcibly
in interfaceChannel.Unsafe
-
deregister
Description copied from interface:Channel.Unsafe
Deregister theChannel
of theChannelPromise
fromEventLoop
and notify theChannelPromise
once the operation was complete.- Specified by:
deregister
in interfaceChannel.Unsafe
-
fireChannelInactiveAndDeregister
-
safeSetSuccess
-
invokeLater
-
beginRead
public void beginRead()Description copied from interface:Channel.Unsafe
Schedules a read operation that fills the inbound buffer of the firstChannelInboundHandler
in theChannelPipeline
. If there's already a pending read operation, this method does nothing.- Specified by:
beginRead
in interfaceChannel.Unsafe
-
pollQueuedMessage
-
doBeginRead
void doBeginRead() -
readEOS
void readEOS() -
updateLocalWindowIfNeeded
private void updateLocalWindowIfNeeded() -
resetReadStatus
private void resetReadStatus() -
notifyReadComplete
void notifyReadComplete(RecvByteBufAllocator.Handle allocHandle, boolean forceReadComplete, boolean inReadLoop) -
doRead0
-
write
Description copied from interface:Channel.Unsafe
Schedules a write operation.- Specified by:
write
in interfaceChannel.Unsafe
-
writeHttp2StreamFrame
-
firstWriteComplete
-
writeComplete
-
wrapStreamClosedError
-
validateStreamFrame
-
flush
public void flush()Description copied from interface:Channel.Unsafe
Flush out all write operations scheduled viaChannel.Unsafe.write(Object, ChannelPromise)
.- Specified by:
flush
in interfaceChannel.Unsafe
-
voidPromise
Description copied from interface:Channel.Unsafe
Return a special ChannelPromise which can be reused and passed to the operations inChannel.Unsafe
. It will never be notified of a success or error and so is only a placeholder for operations that take aChannelPromise
as argument but for which you not want to get notified.- Specified by:
voidPromise
in interfaceChannel.Unsafe
-
outboundBuffer
Description copied from interface:Channel.Unsafe
Returns theChannelOutboundBuffer
of theChannel
where the pending write requests are stored.- Specified by:
outboundBuffer
in interfaceChannel.Unsafe
-