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 java.lang.Object implements Channel.Unsafe
-
-
Field Summary
Fields Modifier and Type Field Description private booleancloseInitiatedprivate booleanreadEOSprivate RecvByteBufAllocator.HandlerecvHandleprivate VoidChannelPromiseunsafeVoidPromiseprivate booleanwriteDoneAndNoFlush
-
Constructor Summary
Constructors Modifier Constructor Description privateHttp2ChannelUnsafe()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginRead()Schedules a read operation that fills the inbound buffer of the firstChannelInboundHandlerin theChannelPipeline.voidbind(java.net.SocketAddress localAddress, ChannelPromise promise)voidclose(ChannelPromise promise)Close theChannelof theChannelPromiseand notify theChannelPromiseonce the operation was complete.voidcloseForcibly()Closes theChannelimmediately without firing any events.voidconnect(java.net.SocketAddress remoteAddress, java.net.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) voiddoBeginRead()(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(java.lang.Runnable task)java.net.SocketAddresslocalAddress()Return theSocketAddressto which is bound local ornullif none.(package private) voidnotifyReadComplete(RecvByteBufAllocator.Handle allocHandle, boolean forceReadComplete)ChannelOutboundBufferoutboundBuffer()Returns theChannelOutboundBufferof theChannelwhere the pending write requests are stored.private java.lang.ObjectpollQueuedMessage()(package private) voidreadEOS()RecvByteBufAllocator.HandlerecvBufAllocHandle()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.java.net.SocketAddressremoteAddress()Return theSocketAddressto which is bound remote ornullif none is bound yet.private voidsafeSetSuccess(ChannelPromise promise)private voidupdateLocalWindowIfNeeded()private Http2StreamFramevalidateStreamFrame(Http2StreamFrame frame)ChannelPromisevoidPromise()Return a special ChannelPromise which can be reused and passed to the operations inChannel.Unsafe.private java.lang.ThrowablewrapStreamClosedError(java.lang.Throwable cause)voidwrite(java.lang.Object msg, ChannelPromise promise)Schedules a write operation.private voidwriteComplete(ChannelFuture future, ChannelPromise promise)private voidwriteHttp2StreamFrame(Http2StreamFrame frame, ChannelPromise promise)
-
-
-
Field Detail
-
unsafeVoidPromise
private final VoidChannelPromise unsafeVoidPromise
-
recvHandle
private RecvByteBufAllocator.Handle recvHandle
-
writeDoneAndNoFlush
private boolean writeDoneAndNoFlush
-
closeInitiated
private boolean closeInitiated
-
readEOS
private boolean readEOS
-
-
Method Detail
-
connect
public void connect(java.net.SocketAddress remoteAddress, java.net.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
public RecvByteBufAllocator.Handle 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
public java.net.SocketAddress localAddress()
Description copied from interface:Channel.UnsafeReturn theSocketAddressto which is bound local ornullif none.- Specified by:
localAddressin interfaceChannel.Unsafe
-
remoteAddress
public java.net.SocketAddress remoteAddress()
Description copied from interface:Channel.UnsafeReturn theSocketAddressto which is bound remote ornullif none is bound yet.- Specified by:
remoteAddressin interfaceChannel.Unsafe
-
register
public void register(EventLoop eventLoop, ChannelPromise promise)
Description copied from interface:Channel.UnsafeRegister theChannelof theChannelPromiseand notify theChannelFutureonce the registration was complete.- Specified by:
registerin interfaceChannel.Unsafe
-
bind
public void bind(java.net.SocketAddress localAddress, ChannelPromise promise)Description copied from interface:Channel.Unsafe- Specified by:
bindin interfaceChannel.Unsafe
-
disconnect
public void disconnect(ChannelPromise promise)
Description copied from interface:Channel.UnsafeDisconnect theChannelof theChannelFutureand notify theChannelPromiseonce the operation was complete.- Specified by:
disconnectin interfaceChannel.Unsafe
-
close
public void close(ChannelPromise promise)
Description copied from interface:Channel.UnsafeClose theChannelof theChannelPromiseand notify theChannelPromiseonce the operation was complete.- Specified by:
closein interfaceChannel.Unsafe
-
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
public void deregister(ChannelPromise promise)
Description copied from interface:Channel.UnsafeDeregister theChannelof theChannelPromisefromEventLoopand notify theChannelPromiseonce the operation was complete.- Specified by:
deregisterin interfaceChannel.Unsafe
-
fireChannelInactiveAndDeregister
private void fireChannelInactiveAndDeregister(ChannelPromise promise, boolean fireChannelInactive)
-
safeSetSuccess
private void safeSetSuccess(ChannelPromise promise)
-
invokeLater
private void invokeLater(java.lang.Runnable task)
-
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
private java.lang.Object pollQueuedMessage()
-
doBeginRead
void doBeginRead()
-
readEOS
void readEOS()
-
updateLocalWindowIfNeeded
private void updateLocalWindowIfNeeded()
-
notifyReadComplete
void notifyReadComplete(RecvByteBufAllocator.Handle allocHandle, boolean forceReadComplete)
-
doRead0
void doRead0(Http2Frame frame, RecvByteBufAllocator.Handle allocHandle)
-
write
public void write(java.lang.Object msg, ChannelPromise promise)Description copied from interface:Channel.UnsafeSchedules a write operation.- Specified by:
writein interfaceChannel.Unsafe
-
writeHttp2StreamFrame
private void writeHttp2StreamFrame(Http2StreamFrame frame, ChannelPromise promise)
-
firstWriteComplete
private void firstWriteComplete(ChannelFuture future, ChannelPromise promise)
-
writeComplete
private void writeComplete(ChannelFuture future, ChannelPromise promise)
-
wrapStreamClosedError
private java.lang.Throwable wrapStreamClosedError(java.lang.Throwable cause)
-
validateStreamFrame
private Http2StreamFrame validateStreamFrame(Http2StreamFrame frame)
-
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
public ChannelPromise 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
public ChannelOutboundBuffer outboundBuffer()
Description copied from interface:Channel.UnsafeReturns theChannelOutboundBufferof theChannelwhere the pending write requests are stored.- Specified by:
outboundBufferin interfaceChannel.Unsafe
-
-