public abstract class AbstractOioByteChannel extends AbstractOioChannel
AbstractChannel.AbstractUnsafeChannel.UnsafeSO_TIMEOUT| Modifier | Constructor and Description |
|---|---|
protected |
AbstractOioByteChannel(Channel parent,
Integer id) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
available()
Return the number of bytes ready to read from the underlying Socket.
|
protected boolean |
checkInputShutdown()
Check if the input was shutdown and if so return
true. |
protected void |
doRead() |
protected abstract int |
doReadBytes(io.netty.buffer.ByteBuf buf)
Read bytes from the underlying Socket.
|
protected int |
doWrite(MessageList<Object> msgs,
int index)
Flush the content of the given
ByteBuf to the remote peer. |
protected abstract void |
doWriteBytes(io.netty.buffer.ByteBuf buf)
Write the data which is hold by the
ByteBuf to the underlying Socket. |
protected abstract void |
doWriteFileRegion(FileRegion region)
Write the data which is hold by the
FileRegion to the underlying Socket. |
protected boolean |
isInputShutdown() |
ChannelMetadata |
metadata()
|
doBeginRead, doConnect, isCompatible, isFlushPending, newUnsafealloc, bind, bind, calculateMessageSize, checkEOF, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doBind, doClose, doDeregister, doDisconnect, doPreClose, doRegister, equals, eventLoop, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, localAddress0, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, remoteAddress0, toString, unsafe, voidPromise, write, write, write, writeprotected boolean isInputShutdown()
public ChannelMetadata metadata()
Channelprotected boolean checkInputShutdown()
true. The default implementation sleeps also for
AbstractOioChannel.SO_TIMEOUT milliseconds to simulate some blocking.protected void doRead()
doRead in class AbstractOioChannelprotected int doWrite(MessageList<Object> msgs, int index) throws Exception
AbstractChannelByteBuf to the remote peer.
Sub-classes may override this as this implementation will just thrown an UnsupportedOperationExceptiondoWrite in class AbstractChannelExceptionprotected abstract int available()
protected abstract int doReadBytes(io.netty.buffer.ByteBuf buf)
throws Exception
buf - the ByteBuf into which the read bytes will be writtenException - is thrown if an error accouredprotected abstract void doWriteBytes(io.netty.buffer.ByteBuf buf)
throws Exception
ByteBuf to the underlying Socket.buf - the ByteBuf which holds the data to transferException - is thrown if an error accouredprotected abstract void doWriteFileRegion(FileRegion region) throws Exception
FileRegion to the underlying Socket.region - the FileRegion which holds the data to transferException - is thrown if an error accouredCopyright © 2008-2013 The Netty Project. All Rights Reserved.