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 booleanprivate booleanprivate booleanprivate RecvByteBufAllocator.Handleprivate booleanprivate final VoidChannelPromiseprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSchedules a read operation that fills the inbound buffer of the firstChannelInboundHandlerin theChannelPipeline.voidbind(SocketAddress localAddress, ChannelPromise promise) voidclose(ChannelPromise promise) Close theChannelof theChannelPromiseand notify theChannelPromiseonce the operation was complete.private voidclose(ChannelPromise promise, Http2Error error) voidCloses theChannelimmediately without firing any events.voidconnect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) voidderegister(ChannelPromise promise) Deregister theChannelof theChannelPromisefromEventLoopand notify theChannelPromiseonce the operation was complete.voiddisconnect(ChannelPromise promise) Disconnect theChannelof theChannelFutureand notify theChannelPromiseonce the operation was complete.(package private) void(package private) voiddoRead0(Http2Frame frame, RecvByteBufAllocator.Handle allocHandle) private voidfireChannelInactiveAndDeregister(ChannelPromise promise, boolean fireChannelInactive) private voidfirstWriteComplete(ChannelFuture future, ChannelPromise promise) voidflush()Flush out all write operations scheduled viaChannel.Unsafe.write(Object, ChannelPromise).private voidinvokeLater(Channel channel, Runnable task) private booleanisEndOfStream(Http2Frame frame) Return theSocketAddressto which is bound local ornullif none.(package private) voidnotifyReadComplete(RecvByteBufAllocator.Handle allocHandle, boolean forceReadComplete, boolean inReadLoop) Returns theChannelOutboundBufferof theChannelwhere the pending write requests are stored.private Object(package private) voidreadEOS()Return the assignedRecvByteBufAllocator.Handlewhich will be used to allocateByteBuf's when receiving data.voidregister(EventLoop eventLoop, ChannelPromise promise) Register theChannelof theChannelPromiseand notify theChannelFutureonce the registration was complete.Return theSocketAddressto which is bound remote ornullif none is bound yet.private voidprivate voidsafeSetSuccess(ChannelPromise promise) private boolean(package private) voidprivate Http2StreamFrameReturn a special ChannelPromise which can be reused and passed to the operations inChannel.Unsafe.private ThrowablewrapStreamClosedError(Throwable cause) voidwrite(Object msg, ChannelPromise promise) Schedules a write operation.private voidwriteComplete(ChannelFuture future, ChannelPromise promise) private voidwriteHttp2StreamFrame(Http2StreamFrame frame, ChannelPromise promise) private ChannelFuturewriteWindowUpdateFrame(Http2WindowUpdateFrame windowUpdateFrame)
-
Field Details
-
unsafeVoidPromise
-
recvHandle
-
writeDoneAndNoFlush
private boolean writeDoneAndNoFlush -
closeInitiated
private boolean closeInitiated -
readEOS
private boolean readEOS -
receivedEndOfStream
private boolean receivedEndOfStream -
sentEndOfStream
private boolean sentEndOfStream
-
-
Constructor Details
-
Http2ChannelUnsafe
private Http2ChannelUnsafe()
-
-
Method Details
-
connect
public void connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) Description copied from interface:Channel.UnsafeConnect theChannelof the givenChannelFuturewith the given remoteSocketAddress. If a specific localSocketAddressshould be used it need to be given as argument. Otherwise just passnullto it. TheChannelPromisewill get notified once the connect operation was complete.- Specified by:
connectin interfaceChannel.Unsafe
-
recvBufAllocHandle
Description copied from interface:Channel.UnsafeReturn the assignedRecvByteBufAllocator.Handlewhich will be used to allocateByteBuf's when receiving data.- Specified by:
recvBufAllocHandlein interfaceChannel.Unsafe
-
localAddress
Description copied from interface:Channel.UnsafeReturn theSocketAddressto which is bound local ornullif none.- Specified by:
localAddressin interfaceChannel.Unsafe
-
remoteAddress
Description copied from interface:Channel.UnsafeReturn theSocketAddressto which is bound remote ornullif none is bound yet.- Specified by:
remoteAddressin interfaceChannel.Unsafe
-
register
Description copied from interface:Channel.UnsafeRegister theChannelof theChannelPromiseand notify theChannelFutureonce the registration was complete.- Specified by:
registerin interfaceChannel.Unsafe
-
bind
Description copied from interface:Channel.Unsafe- Specified by:
bindin interfaceChannel.Unsafe
-
disconnect
Description copied from interface:Channel.UnsafeDisconnect theChannelof theChannelFutureand notify theChannelPromiseonce the operation was complete.- Specified by:
disconnectin interfaceChannel.Unsafe
-
close
Description copied from interface:Channel.UnsafeClose theChannelof theChannelPromiseand notify theChannelPromiseonce the operation was complete.- Specified by:
closein interfaceChannel.Unsafe
-
close
-
closeForcibly
public void closeForcibly()Description copied from interface:Channel.UnsafeCloses theChannelimmediately without firing any events. Probably only useful when registration attempt failed.- Specified by:
closeForciblyin interfaceChannel.Unsafe
-
deregister
Description copied from interface:Channel.UnsafeDeregister theChannelof theChannelPromisefromEventLoopand notify theChannelPromiseonce the operation was complete.- Specified by:
deregisterin interfaceChannel.Unsafe
-
fireChannelInactiveAndDeregister
-
safeSetSuccess
-
invokeLater
-
beginRead
public void beginRead()Description copied from interface:Channel.UnsafeSchedules a read operation that fills the inbound buffer of the firstChannelInboundHandlerin theChannelPipeline. If there's already a pending read operation, this method does nothing.- Specified by:
beginReadin interfaceChannel.Unsafe
-
pollQueuedMessage
-
doBeginRead
void doBeginRead() -
readEOS
void readEOS() -
updateLocalWindowIfNeeded
private boolean updateLocalWindowIfNeeded() -
updateLocalWindowIfNeededAndFlush
void updateLocalWindowIfNeededAndFlush() -
resetReadStatus
private void resetReadStatus() -
notifyReadComplete
void notifyReadComplete(RecvByteBufAllocator.Handle allocHandle, boolean forceReadComplete, boolean inReadLoop) -
doRead0
-
writeWindowUpdateFrame
-
write
Description copied from interface:Channel.UnsafeSchedules a write operation.- Specified by:
writein interfaceChannel.Unsafe
-
isEndOfStream
-
writeHttp2StreamFrame
-
firstWriteComplete
-
writeComplete
-
wrapStreamClosedError
-
validateStreamFrame
-
flush
public void flush()Description copied from interface:Channel.UnsafeFlush out all write operations scheduled viaChannel.Unsafe.write(Object, ChannelPromise).- Specified by:
flushin interfaceChannel.Unsafe
-
voidPromise
Description copied from interface:Channel.UnsafeReturn 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 aChannelPromiseas argument but for which you not want to get notified.- Specified by:
voidPromisein interfaceChannel.Unsafe
-
outboundBuffer
Description copied from interface:Channel.UnsafeReturns theChannelOutboundBufferof theChannelwhere the pending write requests are stored.- Specified by:
outboundBufferin interfaceChannel.Unsafe
-