Class IoUringServerDomainSocketChannel
java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
io.netty.channel.uring.IoUringServerDomainSocketChannel
- All Implemented Interfaces:
Channel, ChannelOutboundInvoker, ServerChannel, ServerDomainSocketChannel, UnixChannel, AttributeMap, Comparable<Channel>
public final class IoUringServerDomainSocketChannel
extends AbstractChannel
implements ServerDomainSocketChannel
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractChannel
AbstractChannel.AbstractUnsafeModifier and TypeClassDescriptionprotected classChannel.Unsafeimplementation which sub-classes must extend and use.Nested classes/interfaces inherited from interface Channel
Channel.UnsafeModifier and TypeInterfaceDescriptionstatic interfaceUnsafe operations that should never be called from user-code. -
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.protected voiddoBind(SocketAddress localAddress) Bind theChannelto theSocketAddressprotected final voiddoClose()Close theChannelprotected final voidprotected voidDisconnect thisChannelfrom its remote peerprotected voiddoRegister(ChannelPromise promise) protected final voidRetains every in-flight write's references before handing off todoShutdownOutput0(), so a write completion that races the shutdown still finds a live reference to release instead of one the outbound buffer already dropped.protected voidPerforms the actual output shutdown.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 laterprotected final booleanReturns 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, equals, eventLoop, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, maxMessagesPerWrite, newChannelPipeline, newId, parent, pipeline, toString, unsafe, validateFileRegion, voidPromiseModifier and TypeMethodDescriptionReturns theChannelFuturewhich will be notified when this channel is closed.final intprotected voidDeprecated.final booleanReturnstrueif and only if the specified object is identical with this channel (i.e:this == o).final inthashCode()Returns the ID of this channel.final ChannelIdid()Returns the globally unique identifier of thisChannel.protected voidDeprecated.no use-case for this.protected voidDeprecated.no use-case for this.booleanprotected final intprotected DefaultChannelPipelineReturns a newDefaultChannelPipelineinstance.protected ChannelIdnewId()Returns a newDefaultChannelIdinstance.parent()Returns the parent of this channel.pipeline()Return the assignedChannelPipeline.toString()Returns theStringrepresentation of this channel.unsafe()Returns an internal-use-only object that provides unsafe operations.protected voidvalidateFileRegion(DefaultFileRegion region, long position) final ChannelPromiseReturn a special ChannelPromise which can be reused for different operations.Methods inherited from class DefaultAttributeMap
attr, hasAttrModifier and TypeMethodDescription<T> Attribute<T> attr(AttributeKey<T> key) Get theAttributefor the givenAttributeKey.<T> booleanhasAttr(AttributeKey<T> key) Methods inherited from interface Channel
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, flush, getOption, isWritable, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, read, setOption, write, write, writeAndFlush, writeAndFlushModifier and TypeMethodDescriptiondefault ByteBufAllocatoralloc()Return the assignedByteBufAllocatorwhich will be used to allocateByteBufs.default ChannelFuturebind(SocketAddress localAddress) Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFuturebind(SocketAddress localAddress, ChannelPromise promise) Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default longGet how many bytes can be written untilChannel.isWritable()returnsfalse.default longGet how many bytes must be drained from underlying buffers untilChannel.isWritable()returnstrue.default ChannelFutureclose()Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureclose(ChannelPromise promise) Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureconnect(SocketAddress remoteAddress) Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureconnect(SocketAddress remoteAddress, ChannelPromise promise) Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureconnect(SocketAddress remoteAddress, SocketAddress localAddress) Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureconnect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureRequest to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFuturederegister(ChannelPromise promise) Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureRequest to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFuturedisconnect(ChannelPromise promise) Request to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default Channelflush()Request to flush all pending messages via this ChannelOutboundInvoker.default <T> TgetOption(ChannelOption<T> option) Return the value of the givenChannelOptiondefault booleanReturnstrueif and only if the I/O thread will perform the requested write operation immediately.default ChannelFuturenewFailedFuture(Throwable cause) Create a newChannelFuturewhich is marked as failed already.default ChannelProgressivePromiseReturn an newChannelProgressivePromisedefault ChannelPromiseReturn a newChannelPromise.default ChannelFutureCreate a newChannelFuturewhich is marked as succeeded already.default Channelread()Request to Read data from theChannelinto the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)event if data was read, and triggers achannelReadCompleteevent so the handler can decide to continue reading.default <T> booleansetOption(ChannelOption<T> option, T value) Sets a configuration property with the specified name and value.default ChannelFutureRequest to write a message via thisChannelHandlerContextthrough theChannelPipeline.default ChannelFuturewrite(Object msg, ChannelPromise promise) Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.default ChannelFuturewriteAndFlush(Object msg) Shortcut for callChannelOutboundInvoker.write(Object)andChannelOutboundInvoker.flush().default ChannelFuturewriteAndFlush(Object msg, ChannelPromise promise) Shortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)andChannelOutboundInvoker.flush().
-
Field Details
-
active
protected volatile boolean active
-
-
Constructor Details
-
IoUringServerDomainSocketChannel
public IoUringServerDomainSocketChannel()
-
-
Method Details
-
config
Description copied from interface:ChannelReturns the configuration of this channel. -
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 interfaceServerDomainSocketChannel- Overrides:
localAddressin classAbstractChannel- Returns:
- the local address of this channel.
nullif this channel is not bound.
-
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 interfaceServerDomainSocketChannel- 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.
-
doBind
Description copied from class:AbstractChannelBind theChannelto theSocketAddress- Throws:
Exception
-
isStreamSocket
protected final boolean isStreamSocket() -
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
-
doShutdownOutput
Retains every in-flight write's references before handing off todoShutdownOutput0(), so a write completion that races the shutdown still finds a live reference to release instead of one the outbound buffer already dropped.- Overrides:
doShutdownOutputin classAbstractChannel- Throws:
Exception
-
doShutdownOutput0
-
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
-
AbstractChannel.doRegister(ChannelPromise)