Class IoUringServerSocketChannel
java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
io.netty.channel.uring.IoUringServerSocketChannel
- All Implemented Interfaces:
Channel, ChannelOutboundInvoker, ServerChannel, ServerSocketChannel, UnixChannel, AttributeMap, Comparable<Channel>
public final class IoUringServerSocketChannel
extends AbstractChannel
implements ServerSocketChannel
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractChannel
AbstractChannel.AbstractUnsafeNested classes/interfaces inherited from interface Channel
Channel.Unsafe -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected final voidcancelOutstandingReads(IoRegistration registration, int numOutstandingReads) Cancel all outstanding readsprotected final voidcancelOutstandingWrites(IoRegistration registration, int numOutstandingWrites) Cancel all outstanding writesprotected static voidconfig()Returns the configuration of this channel.protected final voidSchedule a read operation.voiddoBind(SocketAddress localAddress) Bind theChannelto theSocketAddressprotected final voiddoClose()Close theChannelprotected final voidprotected voidDisconnect thisChannelfrom its remote peerprotected voiddoRegister(ChannelPromise promise) protected final voidFlush the content of the given buffer to the remote peer.final FileDescriptorfd()Returns theFileDescriptorthat is used by thisChannel.protected ObjectInvoked when a new message is added to aChannelOutboundBufferof thisAbstractChannel, so that theChannelimplementation converts the message to another.booleanisActive()Returntrueif theChannelis active and so connected.protected booleanisCompatible(EventLoop loop) Returntrueif the givenEventLoopis compatible with this instance.final booleanisOpen()Returnstrueif theChannelis open and may get active laterReturns the local address where this channel is bound to.protected final SocketAddressReturns theSocketAddresswhich is bound locally.final ChannelMetadatametadata()protected final ByteBufnewDirectBuffer(ByteBuf buf) protected final ByteBufnewDirectBuffer(Object holder, ByteBuf buf) protected final io.netty.channel.uring.AbstractIoUringChannel.AbstractUringUnsafeCreate a newAbstractChannel.AbstractUnsafeinstance which will be used for the life-time of theChannelprotected final shortReturns the next id that should be used when submittingIoUringIoOps.protected final IoRegistrationReturns the remote address where this channel is connected to.protected final SocketAddressReturn theSocketAddresswhich theChannelis connected to.protected voidscheduleWriteIfNeeded(ChannelOutboundBuffer in, boolean submitAndRunNow) protected booleansocketIsEmpty(int flags) Return if the socket is guaranteed to be empty when the submitted io was executed and the completion event be created.protected voidMethods inherited from class AbstractChannel
closeFuture, compareTo, doRegister, doShutdownOutput, equals, eventLoop, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, maxMessagesPerWrite, newChannelPipeline, newId, parent, pipeline, toString, unsafe, validateFileRegion, voidPromiseMethods inherited from class DefaultAttributeMap
attr, hasAttrMethods inherited from interface AttributeMap
attr, hasAttrMethods inherited from interface Channel
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, eventLoop, flush, getOption, id, isActive, isOpen, isRegistered, isWritable, metadata, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, setOption, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushMethods inherited from interface Comparable
compareTo
-
Field Details
-
active
protected volatile boolean active
-
-
Constructor Details
-
IoUringServerSocketChannel
public IoUringServerSocketChannel()
-
-
Method Details
-
config
Description copied from interface:ChannelReturns the configuration of this channel.- Specified by:
configin interfaceChannel- Specified by:
configin interfaceServerSocketChannel
-
remoteAddress
Description copied from interface:ChannelReturns the remote address where this channel is connected to. The returnedSocketAddressis supposed to be down-cast into more concrete type such asInetSocketAddressto retrieve the detailed information.- Specified by:
remoteAddressin interfaceChannel- Specified by:
remoteAddressin interfaceServerSocketChannel- Overrides:
remoteAddressin classAbstractChannel- Returns:
- the remote address of this channel.
nullif this channel is not connected. If this channel is not connected but it can receive messages from arbitrary remote addresses (e.g.DatagramChannel, useDefaultAddressedEnvelope.recipient()to determine the origination of the received message as this method will returnnull.
-
localAddress
Description copied from interface:ChannelReturns the local address where this channel is bound to. The returnedSocketAddressis supposed to be down-cast into more concrete type such asInetSocketAddressto retrieve the detailed information.- Specified by:
localAddressin interfaceChannel- Specified by:
localAddressin interfaceServerSocketChannel- Overrides:
localAddressin classAbstractChannel- Returns:
- the local address of this channel.
nullif this channel is not bound.
-
doBind
Description copied from class:AbstractChannelBind theChannelto theSocketAddress- Throws:
Exception
-
metadata
Description copied from interface:Channel -
doClose
-
newUnsafe
protected final io.netty.channel.uring.AbstractIoUringChannel.AbstractUringUnsafe newUnsafe()Description copied from class:AbstractChannelCreate a newAbstractChannel.AbstractUnsafeinstance which will be used for the life-time of theChannel- Specified by:
newUnsafein classAbstractChannel
-
doWrite
Description copied from class:AbstractChannelFlush the content of the given buffer to the remote peer. -
cancelOutstandingReads
Cancel all outstanding reads- Parameters:
registration- theIoRegistration.numOutstandingReads- the number of outstanding reads, or-1if multi-shot was used.
-
cancelOutstandingWrites
Cancel all outstanding writes- Parameters:
registration- theIoRegistration.numOutstandingWrites- the number of outstanding writes.
-
socketIsEmpty
protected boolean socketIsEmpty(int flags) Return if the socket is guaranteed to be empty when the submitted io was executed and the completion event be created.- Parameters:
flags- the flags that were part of the completion- Returns:
trueif empty.
-
nextOpsId
protected final short nextOpsId()Returns the next id that should be used when submittingIoUringIoOps.- Returns:
- opsId
-
isOpen
-
isActive
-
fd
Description copied from interface:UnixChannelReturns theFileDescriptorthat is used by thisChannel.- Specified by:
fdin interfaceUnixChannel
-
isCompatible
Description copied from class:AbstractChannelReturntrueif the givenEventLoopis compatible with this instance.- Specified by:
isCompatiblein classAbstractChannel
-
newDirectBuffer
-
allowMultiShotPollIn
protected boolean allowMultiShotPollIn() -
newDirectBuffer
-
doDisconnect
Description copied from class:AbstractChannelDisconnect thisChannelfrom its remote peer- Specified by:
doDisconnectin classAbstractChannel- Throws:
Exception
-
doBeginRead
protected final void doBeginRead()Description copied from class:AbstractChannelSchedule a read operation.- Specified by:
doBeginReadin classAbstractChannel
-
scheduleWriteIfNeeded
-
submitAndRunNow
protected void submitAndRunNow() -
registration
-
filterOutboundMessage
Description copied from class:AbstractChannelInvoked when a new message is added to aChannelOutboundBufferof thisAbstractChannel, so that theChannelimplementation converts the message to another. (e.g. heap buffer -> direct buffer)- Overrides:
filterOutboundMessagein classAbstractChannel
-
doRegister
Description copied from class:AbstractChannelIs called after theChannelis registered with itsEventLoopas part of the register process. Subclasses may override this method- Overrides:
doRegisterin classAbstractChannel- Parameters:
promise-ChannelPromisethat must be notified once done to continue the registration.
-
doDeregister
protected final void doDeregister()Description copied from class:AbstractChannel- Overrides:
doDeregisterin classAbstractChannel
-
checkResolvable
-
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
-