Package io.netty.channel.kqueue
Class AbstractKQueueChannel
java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
io.netty.channel.kqueue.AbstractKQueueChannel
- All Implemented Interfaces:
Channel,ChannelOutboundInvoker,UnixChannel,AttributeMap,Comparable<Channel>
- Direct Known Subclasses:
AbstractKQueueDatagramChannel,AbstractKQueueServerChannel,AbstractKQueueStreamChannel
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.netty.channel.AbstractChannel
AbstractChannel.AbstractUnsafeNested classes/interfaces inherited from interface io.netty.channel.Channel
Channel.Unsafe -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprivate ChannelPromiseThe future of the current connection attempt.private Future<?> (package private) booleanprivate SocketAddressprivate static final ChannelMetadataprivate boolean(package private) boolean(package private) KQueueEventLoop.KQueueRegistrationprivate SocketAddressprivate SocketAddress(package private) final BsdSocketprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionAbstractKQueueChannel(Channel parent, BsdSocket fd, boolean active) AbstractKQueueChannel(Channel parent, BsdSocket fd, SocketAddress remote) -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidprivate void(package private) final voidabstract KQueueChannelConfigconfig()Returns the configuration of this channel.protected final voidSchedule a read operation.protected voiddoBind(SocketAddress local) Bind theChannelto theSocketAddressprotected voiddoClose()Close theChannelprotected booleandoConnect(SocketAddress remoteAddress, SocketAddress localAddress) Connect to the remote peerprotected booleandoConnect0(SocketAddress remoteAddress, SocketAddress localAddress) protected voidprotected voidDisconnect thisChannelfrom its remote peerprotected final intdoReadBytes(ByteBuf byteBuf) Read bytes into the givenByteBufand return the amount.protected voidprotected final intdoWriteBytes(ChannelOutboundBuffer in, ByteBuf buf) private voidevSet(short filter, short flags) private voidevSet0(short filter, short flags) private voidevSet0(short filter, short flags, int fflags) final FileDescriptorfd()Returns theFileDescriptorthat is used by thisChannel.booleanisActive()Returntrueif theChannelis active and so connected.private static booleanisAllowHalfClosure(ChannelConfig config) protected booleanisCompatible(EventLoop loop) Returntrueif the givenEventLoopis compatible with this instance.booleanisOpen()Returnstrueif theChannelis open and may get active later(package private) static booleanprotected SocketAddressReturns theSocketAddresswhich is bound locally.metadata()protected final ByteBufnewDirectBuffer(ByteBuf buf) Returns an off-heap copy of the specifiedByteBuf, and releases the original one.protected final ByteBufnewDirectBuffer(Object holder, ByteBuf buf) Returns an off-heap copy of the specifiedByteBuf, and releases the specified holder.private static ByteBufnewDirectBuffer0(Object holder, ByteBuf buf, ByteBufAllocator alloc, int capacity) protected abstract AbstractKQueueChannel.AbstractKQueueUnsafeCreate a newAbstractChannel.AbstractUnsafeinstance which will be used for the life-time of theChannel(package private) voidreadFilter(boolean readFilterEnabled) protected SocketAddressReturn theSocketAddresswhich theChannelis connected to.(package private) void(package private) final booleanshouldBreakReadReady(ChannelConfig config) (package private) void(package private) voidwriteFilter(boolean writeFilterEnabled) Methods inherited from class io.netty.channel.AbstractChannel
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doShutdownOutput, doWrite, equals, eventLoop, filterOutboundMessage, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, toString, unsafe, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlushMethods inherited from class io.netty.util.DefaultAttributeMap
attr, hasAttrMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.netty.util.AttributeMap
attr, hasAttrMethods inherited from interface io.netty.channel.Channel
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isRegistered, isWritable, localAddress, parent, pipeline, read, remoteAddress, unsafeMethods inherited from interface io.netty.channel.ChannelOutboundInvoker
bind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlushMethods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
METADATA
-
connectPromise
The future of the current connection attempt. If not null, subsequent connection attempts will fail. -
connectTimeoutFuture
-
requestedRemoteAddress
-
socket
-
readFilterEnabled
private boolean readFilterEnabled -
writeFilterEnabled
private boolean writeFilterEnabled -
registration
KQueueEventLoop.KQueueRegistration registration -
readReadyRunnablePending
boolean readReadyRunnablePending -
inputClosedSeenErrorOnRead
boolean inputClosedSeenErrorOnRead -
active
protected volatile boolean active -
local
-
remote
-
-
Constructor Details
-
AbstractKQueueChannel
-
AbstractKQueueChannel
AbstractKQueueChannel(Channel parent, BsdSocket fd, SocketAddress remote)
-
-
Method Details
-
isSoErrorZero
-
fd
Description copied from interface:UnixChannelReturns theFileDescriptorthat is used by thisChannel.- Specified by:
fdin interfaceUnixChannel
-
isActive
public boolean isActive()Description copied from interface:ChannelReturntrueif theChannelis active and so connected. -
metadata
Description copied from interface:Channel -
doClose
Description copied from class:AbstractChannelClose theChannel- Specified by:
doClosein classAbstractChannel- Throws:
Exception
-
doDisconnect
Description copied from class:AbstractChannelDisconnect thisChannelfrom its remote peer- Specified by:
doDisconnectin classAbstractChannel- Throws:
Exception
-
resetCachedAddresses
void resetCachedAddresses() -
isCompatible
Description copied from class:AbstractChannelReturntrueif the givenEventLoopis compatible with this instance.- Specified by:
isCompatiblein classAbstractChannel
-
isOpen
public boolean isOpen()Description copied from interface:ChannelReturnstrueif theChannelis open and may get active later -
doDeregister
Description copied from class:AbstractChannel- Overrides:
doDeregisterin classAbstractChannel- Throws:
Exception
-
unregisterFilters
- Throws:
Exception
-
clearRdHup0
private void clearRdHup0() -
doBeginRead
Description copied from class:AbstractChannelSchedule a read operation.- Specified by:
doBeginReadin classAbstractChannel- Throws:
Exception
-
doRegister
Description copied from class:AbstractChannelIs called after theChannelis registered with itsEventLoopas part of the register process. Sub-classes may override this method- Overrides:
doRegisterin classAbstractChannel- Throws:
Exception
-
newUnsafe
Description copied from class:AbstractChannelCreate a newAbstractChannel.AbstractUnsafeinstance which will be used for the life-time of theChannel- Specified by:
newUnsafein classAbstractChannel
-
config
Description copied from interface:ChannelReturns the configuration of this channel. -
newDirectBuffer
Returns an off-heap copy of the specifiedByteBuf, and releases the original one. -
newDirectBuffer
-
newDirectBuffer0
private static ByteBuf newDirectBuffer0(Object holder, ByteBuf buf, ByteBufAllocator alloc, int capacity) -
checkResolvable
-
doReadBytes
Read bytes into the givenByteBufand return the amount.- Throws:
Exception
-
doWriteBytes
- Throws:
Exception
-
shouldBreakReadReady
-
isAllowHalfClosure
-
clearReadFilter
final void clearReadFilter() -
readFilter
- Throws:
IOException
-
writeFilter
- Throws:
IOException
-
evSet
private void evSet(short filter, short flags) -
evSet0
private void evSet0(short filter, short flags) -
evSet0
private void evSet0(short filter, short flags, int fflags) -
doBind
Description copied from class:AbstractChannelBind theChannelto theSocketAddress- Specified by:
doBindin classAbstractChannel- Throws:
Exception
-
doConnect
protected boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception Connect to the remote peer- Throws:
Exception
-
doConnect0
protected boolean doConnect0(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception - Throws:
Exception
-
localAddress0
Description copied from class:AbstractChannelReturns theSocketAddresswhich is bound locally.- Specified by:
localAddress0in classAbstractChannel
-
remoteAddress0
Description copied from class:AbstractChannelReturn theSocketAddresswhich theChannelis connected to.- Specified by:
remoteAddress0in classAbstractChannel
-