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
- Direct Known Subclasses:
AbstractEpollServerChannel.EpollServerSocketUnsafe
,AbstractEpollStreamChannel.EpollStreamUnsafe
,EpollDatagramChannel.EpollDatagramChannelUnsafe
,EpollDomainDatagramChannel.EpollDomainDatagramChannelUnsafe
- Enclosing class:
- AbstractEpollChannel
protected abstract class AbstractEpollChannel.AbstractEpollUnsafe extends AbstractChannel.AbstractUnsafe
-
-
Field Summary
Fields Modifier and Type Field Description private EpollRecvByteAllocatorHandle
allocHandle
private java.lang.Runnable
epollInReadyRunnable
(package private) boolean
maybeMoreDataToRead
(package private) boolean
readPending
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractEpollUnsafe()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
clearEpollIn0()
private void
clearEpollRdHup()
Clear theNative.EPOLLRDHUP
flag from EPOLL, and close on failure.void
connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)
private boolean
doFinishConnect()
Finish the connect(package private) void
epollInBefore()
(package private) void
epollInFinally(ChannelConfig config)
(package private) abstract void
epollInReady()
Called once EPOLLIN event is ready to be processed(package private) void
epollOutReady()
Called once a EPOLLOUT event is ready to be processed(package private) void
epollRdHupReady()
Called once EPOLLRDHUP event is ready to be processed(package private) void
executeEpollInReadyRunnable(ChannelConfig config)
private void
finishConnect()
private void
fireEventAndClose(java.lang.Object evt)
protected void
flush0()
private void
fulfillConnectPromise(ChannelPromise promise, boolean wasActive)
private void
fulfillConnectPromise(ChannelPromise promise, java.lang.Throwable cause)
(package private) EpollRecvByteAllocatorHandle
newEpollHandle(RecvByteBufAllocator.ExtendedHandle handle)
Create a newEpollRecvByteAllocatorHandle
instance.EpollRecvByteAllocatorHandle
recvBufAllocHandle()
Return the assignedRecvByteBufAllocator.Handle
which will be used to allocateByteBuf
's when receiving data.(package private) void
shutdownInput(boolean rdHup)
Shutdown the input side of the channel.-
Methods inherited from class io.netty.channel.AbstractChannel.AbstractUnsafe
annotateConnectException, beginRead, bind, close, closeForcibly, closeIfClosed, deregister, disconnect, ensureOpen, flush, handleWriteError, localAddress, outboundBuffer, prepareToClose, register, remoteAddress, safeSetFailure, safeSetSuccess, shutdownOutput, voidPromise, write
-
-
-
-
Field Detail
-
readPending
boolean readPending
-
maybeMoreDataToRead
boolean maybeMoreDataToRead
-
allocHandle
private EpollRecvByteAllocatorHandle allocHandle
-
epollInReadyRunnable
private final java.lang.Runnable epollInReadyRunnable
-
-
Method Detail
-
epollInReady
abstract void epollInReady()
Called once EPOLLIN event is ready to be processed
-
epollInBefore
final void epollInBefore()
-
epollInFinally
final void epollInFinally(ChannelConfig config)
-
executeEpollInReadyRunnable
final void executeEpollInReadyRunnable(ChannelConfig config)
-
epollRdHupReady
final void epollRdHupReady()
Called once EPOLLRDHUP event is ready to be processed
-
clearEpollRdHup
private void clearEpollRdHup()
Clear theNative.EPOLLRDHUP
flag from EPOLL, and close on failure.
-
shutdownInput
void shutdownInput(boolean rdHup)
Shutdown the input side of the channel.
-
fireEventAndClose
private void fireEventAndClose(java.lang.Object evt)
-
recvBufAllocHandle
public EpollRecvByteAllocatorHandle recvBufAllocHandle()
Description copied from interface:Channel.Unsafe
Return the assignedRecvByteBufAllocator.Handle
which will be used to allocateByteBuf
's when receiving data.- Specified by:
recvBufAllocHandle
in interfaceChannel.Unsafe
- Overrides:
recvBufAllocHandle
in classAbstractChannel.AbstractUnsafe
-
newEpollHandle
EpollRecvByteAllocatorHandle newEpollHandle(RecvByteBufAllocator.ExtendedHandle handle)
Create a newEpollRecvByteAllocatorHandle
instance.- Parameters:
handle
- The handle to wrap with EPOLL specific logic.
-
flush0
protected final void flush0()
- Overrides:
flush0
in 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.Unsafe
Connect theChannel
of the givenChannelFuture
with the given remoteSocketAddress
. If a specific localSocketAddress
should be used it need to be given as argument. Otherwise just passnull
to it. TheChannelPromise
will get notified once the connect operation was complete.
-
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.Exception
Finish the connect- Throws:
java.lang.Exception
-
-