public abstract class AbstractNioChannel extends AbstractChannel
Channel implementations which use a Selector based approach.| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractNioChannel.AbstractNioUnsafe |
static interface |
AbstractNioChannel.NioUnsafe
Special
Unsafe sub-type which allows to access the underlying SelectableChannel |
AbstractChannel.AbstractUnsafeChannel.Unsafe| Modifier and Type | Field and Description |
|---|---|
protected int |
readInterestOp |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractNioChannel(Channel parent,
EventLoop eventLoop,
SelectableChannel ch,
int readInterestOp)
Create a new instance
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doBeginRead()
Schedule a read operation.
|
protected abstract boolean |
doConnect(SocketAddress remoteAddress,
SocketAddress localAddress)
Connect to the remote peer
|
protected void |
doDeregister()
|
protected abstract void |
doFinishConnect()
Finish the connect
|
protected void |
doRegister()
|
NioEventLoop |
eventLoop()
|
protected boolean |
isCompatible(EventLoop loop)
Return
true if the given EventLoop is compatible with this instance. |
protected boolean |
isInputShutdown()
Return
true if the input of this Channel is shutdown |
boolean |
isOpen()
Returns
true if the Channel is open an may get active later |
protected SelectableChannel |
javaChannel() |
protected SelectionKey |
selectionKey()
Return the current
SelectionKey |
AbstractNioChannel.NioUnsafe |
unsafe()
Returns an internal-use-only object that provides unsafe operations.
|
alloc, bind, bind, checkEOF, close, close, closeFuture, compareTo, connect, connect, connect, connect, disconnect, disconnect, doBind, doClose, doDisconnect, doWrite, equals, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, localAddress0, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, newUnsafe, parent, pipeline, read, remoteAddress, remoteAddress0, toString, voidPromise, write, write, writeAndFlush, writeAndFlushprotected AbstractNioChannel(Channel parent, EventLoop eventLoop, SelectableChannel ch, int readInterestOp)
parent - the parent Channel by which this instance was created. May be nullch - the underlying SelectableChannel on which it operatesreadInterestOp - the ops to set to receive data from the SelectableChannelpublic boolean isOpen()
Channeltrue if the Channel is open an may get active laterpublic AbstractNioChannel.NioUnsafe unsafe()
Channelunsafe in interface Channelunsafe in class AbstractChannelprotected SelectableChannel javaChannel()
public NioEventLoop eventLoop()
ChanneleventLoop in interface ChanneleventLoop in class AbstractChannelprotected SelectionKey selectionKey()
SelectionKeyprotected boolean isInputShutdown()
true if the input of this Channel is shutdownprotected boolean isCompatible(EventLoop loop)
AbstractChanneltrue if the given EventLoop is compatible with this instance.isCompatible in class AbstractChannelprotected void doRegister()
throws Exception
AbstractChannelChannel is registered with its EventLoop as part of the register
process.
Sub-classes may override this methoddoRegister in class AbstractChannelExceptionprotected void doDeregister()
throws Exception
AbstractChanneldoDeregister in class AbstractChannelExceptionprotected void doBeginRead()
throws Exception
AbstractChanneldoBeginRead in class AbstractChannelExceptionprotected abstract boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception
ExceptionCopyright © 2008–2013 The Netty Project. All rights reserved.