@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.AbstractKQueueUnsafe
AbstractChannel.AbstractUnsafe
Channel.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, writeFilter
alloc, 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, writeAndFlush
attr, hasAttr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, config, eventLoop, flush, id, isActive, isOpen, isRegistered, isWritable, localAddress, parent, pipeline, read, remoteAddress, unsafe
attr, hasAttr
bind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlush
private 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()
AbstractChannel
AbstractChannel.AbstractUnsafe
instance which will be used for the life-time of the Channel
newUnsafe
in class AbstractKQueueChannel
public ChannelMetadata metadata()
Channel
metadata
in interface Channel
metadata
in class AbstractKQueueChannel
private 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.Exception
private boolean writeBytesMultiple(ChannelOutboundBuffer in, IovArray array, int writeSpinCount) throws java.io.IOException
java.io.IOException
private boolean writeBytesMultiple(ChannelOutboundBuffer in, java.nio.ByteBuffer[] nioBuffers, int nioBufferCnt, long expectedWrittenBytes, int writeSpinCount) throws java.io.IOException
java.io.IOException
private boolean writeDefaultFileRegion(ChannelOutboundBuffer in, DefaultFileRegion region, int writeSpinCount) throws java.lang.Exception
DefaultFileRegion
region
- the DefaultFileRegion
from which the bytes should be writtenjava.lang.Exception
private boolean writeFileRegion(ChannelOutboundBuffer in, FileRegion region, int writeSpinCount) throws java.lang.Exception
java.lang.Exception
protected void doWrite(ChannelOutboundBuffer in) throws java.lang.Exception
AbstractChannel
doWrite
in class AbstractChannel
java.lang.Exception
protected boolean doWriteSingle(ChannelOutboundBuffer in, int writeSpinCount) throws java.lang.Exception
java.lang.Exception
private boolean doWriteMultiple(ChannelOutboundBuffer in, int writeSpinCount) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object filterOutboundMessage(java.lang.Object msg)
AbstractChannel
ChannelOutboundBuffer
of this AbstractChannel
, so that
the Channel
implementation converts the message to another. (e.g. heap buffer -> direct buffer)filterOutboundMessage
in class AbstractChannel
private void shutdownOutput0(ChannelPromise promise)
private void shutdownInput0(ChannelPromise promise)
private void shutdown0(ChannelPromise promise)
public boolean isOutputShutdown()
isOutputShutdown
in interface DuplexChannel
Socket.isOutputShutdown()
public boolean isInputShutdown()
DuplexChannel
true
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 DuplexChannel
public boolean isShutdown()
DuplexChannel
isShutdown
in interface DuplexChannel
public ChannelFuture shutdownOutput()
shutdownOutput
in interface DuplexChannel
Socket.shutdownOutput()
public ChannelFuture shutdownOutput(ChannelPromise promise)
DuplexChannel
ChannelPromise
.shutdownOutput
in interface DuplexChannel
Socket.shutdownOutput()
public ChannelFuture shutdownInput()
shutdownInput
in interface DuplexChannel
Socket.shutdownInput()
public ChannelFuture shutdownInput(ChannelPromise promise)
DuplexChannel
ChannelPromise
.shutdownInput
in interface DuplexChannel
Socket.shutdownInput()
public ChannelFuture shutdown()
DuplexChannel
shutdown
in interface DuplexChannel
public ChannelFuture shutdown(ChannelPromise promise)
DuplexChannel
shutdown
in interface DuplexChannel
promise
- will be completed when both shutdown operations complete.protected void doClose() throws java.lang.Exception
AbstractChannel
Channel
doClose
in class AbstractKQueueChannel
java.lang.Exception
protected boolean doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress) throws java.lang.Exception
java.lang.Exception