Class AbstractEpollChannel.AbstractEpollUnsafe
java.lang.Object
io.netty.channel.AbstractChannel.AbstractUnsafe
io.netty.channel.epoll.AbstractEpollChannel.AbstractEpollUnsafe
- All Implemented Interfaces:
Channel.Unsafe, EpollIoHandle, IoHandle, 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Channelchannel()protected final voidprivate voidClear theNative.EPOLLRDHUPflag from EPOLL, and close on failure.voidclose()Called once theIoHandleshould be closed.voidconnect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) private booleanFinish the connect(package private) abstract voidCalled once EPOLLIN event is ready to be processed(package private) final voidCalled once a EPOLLOUT event is ready to be processed(package private) final voidCalled once EPOLLRDHUP event is ready to be processedfd()Returns theFileDescriptorthat used by thisIoHandle.private voidprivate voidfireEventAndClose(Object evt) protected final voidflush0()private voidfulfillConnectPromise(ChannelPromise promise, boolean wasActive) private voidfulfillConnectPromise(ChannelPromise promise, Throwable cause) voidhandle(IoRegistration registration, IoEvent event) Be called once there is something to handle.(package private) EpollRecvByteAllocatorHandleCreate a newEpollRecvByteAllocatorHandleinstance.Return the assignedRecvByteBufAllocator.Handlewhich will be used to allocateByteBuf's when receiving data.(package private) final booleanshouldStopReading(ChannelConfig config) (package private) voidshutdownInput(boolean allDataRead) Shutdown the input side of the channel.Methods inherited from class AbstractChannel.AbstractUnsafe
annotateConnectException, beginRead, bind, close, close, closeForcibly, closeIfClosed, deregister, disconnect, ensureOpen, flush, handleWriteError, localAddress, outboundBuffer, prepareToClose, register, remoteAddress, safeSetFailure, safeSetSuccess, shutdownOutput, voidPromise, writeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IoHandle
registered, unregistered
-
Field Details
-
readPending
boolean readPending -
allocHandle
-
-
Constructor Details
-
AbstractEpollUnsafe
protected AbstractEpollUnsafe()
-
-
Method Details
-
channel
Channel channel() -
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.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceIoHandle
-
handle
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
-
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
-
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
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(SocketAddress remoteAddress, 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
-
fulfillConnectPromise
-
finishConnect
private void finishConnect() -
doFinishConnect
-