@UnstableApi public abstract class AbstractKQueueStreamChannel extends AbstractKQueueChannel implements DuplexChannel
| Modifier and Type | Class and Description |
|---|---|
private class |
AbstractKQueueStreamChannel.KQueueSocketWritableByteChannel |
(package private) class |
AbstractKQueueStreamChannel.KQueueStreamUnsafe |
AbstractKQueueChannel.AbstractKQueueUnsafeAbstractChannel.AbstractUnsafeChannel.Unsafe| Modifier and Type | Field and Description |
|---|---|
private java.nio.channels.WritableByteChannel |
byteChannel |
private ChannelPromise |
connectPromise |
private java.util.concurrent.ScheduledFuture<?> |
connectTimeoutFuture |
private static java.nio.channels.ClosedChannelException |
DO_CLOSE_CLOSED_CHANNEL_EXCEPTION |
private static java.lang.String |
EXPECTED_TYPES |
private static ChannelMetadata |
METADATA |
private java.net.SocketAddress |
requestedRemoteAddress |
active, inputClosedSeenErrorOnRead, jniSelfPtr, readReadyRunnablePending, socket| Constructor and Description |
|---|
AbstractKQueueStreamChannel(BsdSocket fd) |
AbstractKQueueStreamChannel(Channel parent,
BsdSocket fd,
boolean active) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doClose()
Close the
Channel |
protected boolean |
doConnect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
Connect to the remote peer
|
protected void |
doWrite(ChannelOutboundBuffer in)
Flush the content of the given buffer to the remote peer.
|
private boolean |
doWriteMultiple(ChannelOutboundBuffer in,
int writeSpinCount) |
protected boolean |
doWriteSingle(ChannelOutboundBuffer in,
int writeSpinCount) |
protected java.lang.Object |
filterOutboundMessage(java.lang.Object msg)
Invoked when a new message is added to a
ChannelOutboundBuffer of this AbstractChannel, so that
the Channel implementation converts the message to another. |
boolean |
isInputShutdown()
Returns
true if and only if the remote peer shut down its output so that no more
data is received from this channel. |
boolean |
isOutputShutdown() |
boolean |
isShutdown()
Determine if both the input and output of this channel have been shutdown.
|
ChannelMetadata |
metadata()
|
protected AbstractKQueueChannel.AbstractKQueueUnsafe |
newUnsafe()
Create a new
AbstractChannel.AbstractUnsafe instance which will be used for the life-time of the Channel |
ChannelFuture |
shutdown()
Will shutdown the input and output sides of this channel.
|
ChannelFuture |
shutdown(ChannelPromise promise)
Will shutdown the input and output sides of this channel.
|
private void |
shutdown0(ChannelPromise promise) |
ChannelFuture |
shutdownInput() |
ChannelFuture |
shutdownInput(ChannelPromise promise)
Will shutdown the input and notify
ChannelPromise. |
private void |
shutdownInput0(ChannelPromise promise) |
ChannelFuture |
shutdownOutput() |
ChannelFuture |
shutdownOutput(ChannelPromise promise)
Will shutdown the output and notify
ChannelPromise. |
private void |
shutdownOutput0(ChannelPromise promise) |
private boolean |
writeBytes(ChannelOutboundBuffer in,
ByteBuf buf,
int writeSpinCount)
Write bytes form the given
ByteBuf to the underlying Channel. |
private boolean |
writeBytesMultiple(ChannelOutboundBuffer in,
java.nio.ByteBuffer[] nioBuffers,
int nioBufferCnt,
long expectedWrittenBytes,
int writeSpinCount) |
private boolean |
writeBytesMultiple(ChannelOutboundBuffer in,
IovArray array,
int writeSpinCount) |
private boolean |
writeDefaultFileRegion(ChannelOutboundBuffer in,
DefaultFileRegion region,
int writeSpinCount)
Write a
DefaultFileRegion |
private boolean |
writeFileRegion(ChannelOutboundBuffer in,
FileRegion region,
int writeSpinCount) |
checkResolvable, clearReadFilter, config, doBeginRead, doDeregister, doDisconnect, doReadBytes, doRegister, doWriteBytes, fd, isActive, isAllowHalfClosure, isCompatible, isOpen, isSoErrorZero, newDirectBuffer, newDirectBuffer, readFilter, shouldBreakReadReady, writeFilteralloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doBind, equals, eventLoop, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, localAddress0, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, remoteAddress0, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushattr, hasAttrclone, finalize, getClass, notify, notifyAll, wait, wait, waitalloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, config, eventLoop, flush, id, isActive, isOpen, isRegistered, isWritable, localAddress, parent, pipeline, read, remoteAddress, unsafeattr, hasAttrbind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlushprivate static final ChannelMetadata METADATA
private static final java.nio.channels.ClosedChannelException DO_CLOSE_CLOSED_CHANNEL_EXCEPTION
private static final java.lang.String EXPECTED_TYPES
private ChannelPromise connectPromise
private java.util.concurrent.ScheduledFuture<?> connectTimeoutFuture
private java.net.SocketAddress requestedRemoteAddress
private java.nio.channels.WritableByteChannel byteChannel
AbstractKQueueStreamChannel(Channel parent, BsdSocket fd, boolean active)
AbstractKQueueStreamChannel(BsdSocket fd)
protected AbstractKQueueChannel.AbstractKQueueUnsafe newUnsafe()
AbstractChannelAbstractChannel.AbstractUnsafe instance which will be used for the life-time of the ChannelnewUnsafe in class AbstractKQueueChannelpublic ChannelMetadata metadata()
Channelmetadata in interface Channelmetadata in class AbstractKQueueChannelprivate boolean writeBytes(ChannelOutboundBuffer in, ByteBuf buf, int writeSpinCount) throws java.lang.Exception
ByteBuf to the underlying Channel.buf - the ByteBuf from which the bytes should be writtenjava.lang.Exceptionprivate boolean writeBytesMultiple(ChannelOutboundBuffer in, IovArray array, int writeSpinCount) throws java.io.IOException
java.io.IOExceptionprivate boolean writeBytesMultiple(ChannelOutboundBuffer in, java.nio.ByteBuffer[] nioBuffers, int nioBufferCnt, long expectedWrittenBytes, int writeSpinCount) throws java.io.IOException
java.io.IOExceptionprivate boolean writeDefaultFileRegion(ChannelOutboundBuffer in, DefaultFileRegion region, int writeSpinCount) throws java.lang.Exception
DefaultFileRegionregion - the DefaultFileRegion from which the bytes should be writtenjava.lang.Exceptionprivate boolean writeFileRegion(ChannelOutboundBuffer in, FileRegion region, int writeSpinCount) throws java.lang.Exception
java.lang.Exceptionprotected void doWrite(ChannelOutboundBuffer in) throws java.lang.Exception
AbstractChanneldoWrite in class AbstractChanneljava.lang.Exceptionprotected boolean doWriteSingle(ChannelOutboundBuffer in, int writeSpinCount) throws java.lang.Exception
java.lang.Exceptionprivate boolean doWriteMultiple(ChannelOutboundBuffer in, int writeSpinCount) throws java.lang.Exception
java.lang.Exceptionprotected java.lang.Object filterOutboundMessage(java.lang.Object msg)
AbstractChannelChannelOutboundBuffer of this AbstractChannel, so that
the Channel implementation converts the message to another. (e.g. heap buffer -> direct buffer)filterOutboundMessage in class AbstractChannelprivate void shutdownOutput0(ChannelPromise promise)
private void shutdownInput0(ChannelPromise promise)
private void shutdown0(ChannelPromise promise)
public boolean isOutputShutdown()
isOutputShutdown in interface DuplexChannelSocket.isOutputShutdown()public boolean isInputShutdown()
DuplexChanneltrue if and only if the remote peer shut down its output so that no more
data is received from this channel. Note that the semantic of this method is different from
that of Socket.shutdownInput() and Socket.isInputShutdown().isInputShutdown in interface DuplexChannelpublic boolean isShutdown()
DuplexChannelisShutdown in interface DuplexChannelpublic ChannelFuture shutdownOutput()
shutdownOutput in interface DuplexChannelSocket.shutdownOutput()public ChannelFuture shutdownOutput(ChannelPromise promise)
DuplexChannelChannelPromise.shutdownOutput in interface DuplexChannelSocket.shutdownOutput()public ChannelFuture shutdownInput()
shutdownInput in interface DuplexChannelSocket.shutdownInput()public ChannelFuture shutdownInput(ChannelPromise promise)
DuplexChannelChannelPromise.shutdownInput in interface DuplexChannelSocket.shutdownInput()public ChannelFuture shutdown()
DuplexChannelshutdown in interface DuplexChannelpublic ChannelFuture shutdown(ChannelPromise promise)
DuplexChannelshutdown in interface DuplexChannelpromise - will be completed when both shutdown operations complete.protected void doClose()
throws java.lang.Exception
AbstractChannelChanneldoClose in class AbstractKQueueChanneljava.lang.Exceptionprotected boolean doConnect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
throws java.lang.Exception
java.lang.Exception