Package io.netty.channel.epoll
Class AbstractEpollChannel.AbstractEpollUnsafe
- java.lang.Object
-
- io.netty.channel.AbstractChannel.AbstractUnsafe
-
- io.netty.channel.epoll.AbstractEpollChannel.AbstractEpollUnsafe
-
- All Implemented Interfaces:
Channel.Unsafe,EpollIoHandle,IoHandle,java.lang.AutoCloseable
- Direct Known Subclasses:
AbstractEpollServerChannel.EpollServerSocketUnsafe,AbstractEpollStreamChannel.EpollStreamUnsafe,EpollDatagramChannel.EpollDatagramChannelUnsafe,EpollDomainDatagramChannel.EpollDomainDatagramChannelUnsafe
- Enclosing class:
- AbstractEpollChannel
protected abstract class AbstractEpollChannel.AbstractEpollUnsafe extends AbstractChannel.AbstractUnsafe implements EpollIoHandle
-
-
Field Summary
Fields Modifier and Type Field Description private EpollRecvByteAllocatorHandleallocHandle(package private) booleanreadPending
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractEpollUnsafe()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) Channelchannel()protected voidclearEpollIn0()private voidclearEpollRdHup()Clear theNative.EPOLLRDHUPflag from EPOLL, and close on failure.voidclose()Called once theIoHandleshould be closed.voidconnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)private booleandoFinishConnect()Finish the connect(package private) abstract voidepollInReady()Called once EPOLLIN event is ready to be processed(package private) voidepollOutReady()Called once a EPOLLOUT event is ready to be processed(package private) voidepollRdHupReady()Called once EPOLLRDHUP event is ready to be processedFileDescriptorfd()Returns theFileDescriptorthat used by thisIoHandle.private voidfinishConnect()private voidfireEventAndClose(java.lang.Object evt)protected voidflush0()private voidfulfillConnectPromise(ChannelPromise promise, boolean wasActive)private voidfulfillConnectPromise(ChannelPromise promise, java.lang.Throwable cause)voidhandle(IoRegistration registration, IoEvent event)Be called once there is something to handle.(package private) EpollRecvByteAllocatorHandlenewEpollHandle(RecvByteBufAllocator.ExtendedHandle handle)Create a newEpollRecvByteAllocatorHandleinstance.EpollRecvByteAllocatorHandlerecvBufAllocHandle()Return the assignedRecvByteBufAllocator.Handlewhich will be used to allocateByteBuf's when receiving data.(package private) booleanshouldStopReading(ChannelConfig config)(package private) voidshutdownInput(boolean allDataRead)Shutdown the input side of the channel.-
Methods inherited from class io.netty.channel.AbstractChannel.AbstractUnsafe
annotateConnectException, beginRead, bind, close, close, closeForcibly, closeIfClosed, deregister, disconnect, ensureOpen, flush, handleWriteError, localAddress, outboundBuffer, prepareToClose, register, remoteAddress, safeSetFailure, safeSetSuccess, shutdownOutput, voidPromise, write
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.channel.IoHandle
registered, unregistered
-
-
-
-
Field Detail
-
readPending
boolean readPending
-
allocHandle
private EpollRecvByteAllocatorHandle allocHandle
-
-
Method Detail
-
channel
Channel channel()
-
fd
public FileDescriptor fd()
Description copied from interface:EpollIoHandleReturns theFileDescriptorthat used by thisIoHandle.- Specified by:
fdin interfaceEpollIoHandle- Returns:
- fd
-
close
public void close()
Description copied from interface:IoHandleCalled once theIoHandleshould be closed. Even once this method is called this handle might still receive events viaIoHandle.handle(IoRegistration, IoEvent)(if it was previous be registered and so itsIoHandle.registered()method was called) until theIoHandle.unregistered()method is called.
-
handle
public void handle(IoRegistration registration, IoEvent event)
Description copied from interface:IoHandleBe called once there is something to handle.
-
epollInReady
abstract void epollInReady()
Called once EPOLLIN event is ready to be processed
-
shouldStopReading
final boolean shouldStopReading(ChannelConfig config)
-
epollRdHupReady
final void epollRdHupReady()
Called once EPOLLRDHUP event is ready to be processed
-
clearEpollRdHup
private void clearEpollRdHup()
Clear theNative.EPOLLRDHUPflag from EPOLL, and close on failure.
-
shutdownInput
void shutdownInput(boolean allDataRead)
Shutdown the input side of the channel.
-
fireEventAndClose
private void fireEventAndClose(java.lang.Object evt)
-
recvBufAllocHandle
public EpollRecvByteAllocatorHandle recvBufAllocHandle()
Description copied from interface:Channel.UnsafeReturn the assignedRecvByteBufAllocator.Handlewhich will be used to allocateByteBuf's when receiving data.- Specified by:
recvBufAllocHandlein interfaceChannel.Unsafe- Overrides:
recvBufAllocHandlein classAbstractChannel.AbstractUnsafe
-
newEpollHandle
EpollRecvByteAllocatorHandle newEpollHandle(RecvByteBufAllocator.ExtendedHandle handle)
Create a newEpollRecvByteAllocatorHandleinstance.- Parameters:
handle- The handle to wrap with EPOLL specific logic.
-
flush0
protected final void flush0()
- Overrides:
flush0in classAbstractChannel.AbstractUnsafe
-
epollOutReady
final void epollOutReady()
Called once a EPOLLOUT event is ready to be processed
-
clearEpollIn0
protected final void clearEpollIn0()
-
connect
public void connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)Description copied from interface:Channel.UnsafeConnect theChannelof the givenChannelFuturewith the given remoteSocketAddress. If a specific localSocketAddressshould be used it need to be given as argument. Otherwise just passnullto it. TheChannelPromisewill get notified once the connect operation was complete.- Specified by:
connectin interfaceChannel.Unsafe
-
fulfillConnectPromise
private void fulfillConnectPromise(ChannelPromise promise, boolean wasActive)
-
fulfillConnectPromise
private void fulfillConnectPromise(ChannelPromise promise, java.lang.Throwable cause)
-
finishConnect
private void finishConnect()
-
doFinishConnect
private boolean doFinishConnect() throws java.lang.ExceptionFinish the connect- Throws:
java.lang.Exception
-
-