protected abstract class AbstractChannel.AbstractUnsafe extends java.lang.Object implements Channel.Unsafe
Unsafe implementation which sub-classes must extend and use.| 限定符 | 构造器和说明 | 
|---|---|
| protected  | AbstractUnsafe() | 
| 限定符和类型 | 方法和说明 | 
|---|---|
| protected java.lang.Throwable | annotateConnectException(java.lang.Throwable cause,
                        java.net.SocketAddress remoteAddress)Appends the remote address to the message of the exceptions caused by connection attempt failure. | 
| void | beginRead()Schedules a read operation that fills the inbound buffer of the first  ChannelInboundHandlerin theChannelPipeline. | 
| void | bind(java.net.SocketAddress localAddress,
    ChannelPromise promise) | 
| void | close(ChannelPromise promise)Close the  Channelof theChannelPromiseand notify theChannelPromiseonce the
 operation was complete. | 
| void | closeForcibly()Closes the  Channelimmediately without firing any events. | 
| protected void | closeIfClosed() | 
| void | deregister(ChannelPromise promise)Deregister the  Channelof theChannelPromisefromEventLoopand notify theChannelPromiseonce the operation was complete. | 
| void | disconnect(ChannelPromise promise)Disconnect the  Channelof theChannelFutureand notify theChannelPromiseonce the
 operation was complete. | 
| protected boolean | ensureOpen(ChannelPromise promise) | 
| void | flush()Flush out all write operations scheduled via  Channel.Unsafe.write(Object, ChannelPromise). | 
| protected void | flush0() | 
| protected void | handleWriteError(java.lang.Throwable t) | 
| java.net.SocketAddress | localAddress()Return the  SocketAddressto which is bound local ornullif none. | 
| ChannelOutboundBuffer | outboundBuffer()Returns the  ChannelOutboundBufferof theChannelwhere the pending write requests are stored. | 
| protected java.util.concurrent.Executor | prepareToClose()Prepares to close the  Channel. | 
| RecvByteBufAllocator.Handle | recvBufAllocHandle()Return the assigned  RecvByteBufAllocator.Handlewhich will be used to allocateByteBuf's when
 receiving data. | 
| void | register(EventLoop eventLoop,
        ChannelPromise promise)Register the  Channelof theChannelPromiseand notify
 theChannelFutureonce the registration was complete. | 
| java.net.SocketAddress | remoteAddress()Return the  SocketAddressto which is bound remote ornullif none is bound yet. | 
| protected void | safeSetFailure(ChannelPromise promise,
              java.lang.Throwable cause)Marks the specified  promiseas failure. | 
| protected void | safeSetSuccess(ChannelPromise promise)Marks the specified  promiseas success. | 
| void | shutdownOutput(ChannelPromise promise)Shutdown the output portion of the corresponding  Channel. | 
| ChannelPromise | voidPromise()Return a special ChannelPromise which can be reused and passed to the operations in  Channel.Unsafe. | 
| void | write(java.lang.Object msg,
     ChannelPromise promise)Schedules a write operation. | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnectpublic RecvByteBufAllocator.Handle recvBufAllocHandle()
Channel.UnsafeRecvByteBufAllocator.Handle which will be used to allocate ByteBuf's when
 receiving data.recvBufAllocHandle 在接口中 Channel.Unsafepublic final ChannelOutboundBuffer outboundBuffer()
Channel.UnsafeChannelOutboundBuffer of the Channel where the pending write requests are stored.outboundBuffer 在接口中 Channel.Unsafepublic final java.net.SocketAddress localAddress()
Channel.UnsafeSocketAddress to which is bound local or
 null if none.localAddress 在接口中 Channel.Unsafepublic final java.net.SocketAddress remoteAddress()
Channel.UnsafeSocketAddress to which is bound remote or
 null if none is bound yet.remoteAddress 在接口中 Channel.Unsafepublic final void register(EventLoop eventLoop, ChannelPromise promise)
Channel.UnsafeChannel of the ChannelPromise and notify
 the ChannelFuture once the registration was complete.register 在接口中 Channel.Unsafepublic final void bind(java.net.SocketAddress localAddress,
                       ChannelPromise promise)
Channel.Unsafebind 在接口中 Channel.Unsafepublic final void disconnect(ChannelPromise promise)
Channel.UnsafeChannel of the ChannelFuture and notify the ChannelPromise once the
 operation was complete.disconnect 在接口中 Channel.Unsafepublic void close(ChannelPromise promise)
Channel.UnsafeChannel of the ChannelPromise and notify the ChannelPromise once the
 operation was complete.close 在接口中 Channel.Unsafe@UnstableApi public final void shutdownOutput(ChannelPromise promise)
Channel.
 For example this will clean up the ChannelOutboundBuffer and not allow any more writes.public final void closeForcibly()
Channel.UnsafeChannel immediately without firing any events.  Probably only useful
 when registration attempt failed.closeForcibly 在接口中 Channel.Unsafepublic final void deregister(ChannelPromise promise)
Channel.UnsafeChannel of the ChannelPromise from EventLoop and notify the
 ChannelPromise once the operation was complete.deregister 在接口中 Channel.Unsafepublic final void beginRead()
Channel.UnsafeChannelInboundHandler in the
 ChannelPipeline.  If there's already a pending read operation, this method does nothing.beginRead 在接口中 Channel.Unsafepublic final void write(java.lang.Object msg,
                        ChannelPromise promise)
Channel.Unsafewrite 在接口中 Channel.Unsafepublic final void flush()
Channel.UnsafeChannel.Unsafe.write(Object, ChannelPromise).flush 在接口中 Channel.Unsafeprotected void flush0()
protected final void handleWriteError(java.lang.Throwable t)
public final ChannelPromise voidPromise()
Channel.UnsafeChannel.Unsafe.
 It will never be notified of a success or error and so is only a placeholder for operations
 that take a ChannelPromise as argument but for which you not want to get notified.voidPromise 在接口中 Channel.Unsafeprotected final boolean ensureOpen(ChannelPromise promise)
protected final void safeSetSuccess(ChannelPromise promise)
promise as success.  If the promise is done already, log a message.protected final void safeSetFailure(ChannelPromise promise, java.lang.Throwable cause)
promise as failure.  If the promise is done already, log a message.protected final void closeIfClosed()
protected final java.lang.Throwable annotateConnectException(java.lang.Throwable cause,
                                                             java.net.SocketAddress remoteAddress)
protected java.util.concurrent.Executor prepareToClose()
Channel. If this method returns an Executor, the
 caller must call the Executor.execute(Runnable) method with a task that calls
 AbstractChannel.doClose() on the returned Executor. If this method returns null,
 AbstractChannel.doClose() must be called from the caller thread. (i.e. EventLoop)