Package io.netty.channel.uring
Class IoUringDomainSocketChannel
- java.lang.Object
-
- io.netty.util.DefaultAttributeMap
-
- io.netty.channel.AbstractChannel
-
- io.netty.channel.uring.AbstractIoUringChannel
-
- io.netty.channel.uring.AbstractIoUringStreamChannel
-
- io.netty.channel.uring.IoUringDomainSocketChannel
-
- All Implemented Interfaces:
Channel,ChannelOutboundInvoker,DuplexChannel,DomainSocketChannel,UnixChannel,AttributeMap,java.lang.Comparable<Channel>
public final class IoUringDomainSocketChannel extends AbstractIoUringStreamChannel implements DomainSocketChannel
DomainSocketChannelimplementation that uses linux io_uring
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classIoUringDomainSocketChannel.IoUringDomainSocketUnsafe-
Nested classes/interfaces inherited from class io.netty.channel.uring.AbstractIoUringStreamChannel
AbstractIoUringStreamChannel.IoUringStreamUnsafe
-
Nested classes/interfaces inherited from class io.netty.channel.uring.AbstractIoUringChannel
AbstractIoUringChannel.AbstractUringUnsafe
-
Nested classes/interfaces inherited from class io.netty.channel.AbstractChannel
AbstractChannel.AbstractUnsafe
-
Nested classes/interfaces inherited from interface io.netty.channel.Channel
Channel.Unsafe
-
-
Field Summary
Fields Modifier and Type Field Description private IoUringDomainSocketChannelConfigconfigprivate DomainSocketAddresslocalprivate DomainSocketAddressremote-
Fields inherited from class io.netty.channel.uring.AbstractIoUringStreamChannel
readId, readOpCode, writeId, writeOpCode
-
Fields inherited from class io.netty.channel.uring.AbstractIoUringChannel
active, socket, writeTracker
-
-
Constructor Summary
Constructors Constructor Description IoUringDomainSocketChannel()IoUringDomainSocketChannel(Channel parent, FileDescriptor fd)IoUringDomainSocketChannel(Channel parent, LinuxSocket fd)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanallowMultiShotPollIn()DomainSocketChannelConfigconfig()Returns the configuration of this channel.protected java.lang.ObjectfilterOutboundMessage(java.lang.Object msg)Invoked when a new message is added to aChannelOutboundBufferof thisAbstractChannel, so that theChannelimplementation converts the message to another.(package private) booleanisPollInFirst()DomainSocketAddresslocalAddress()Returns the local address where this channel is bound to.protected AbstractIoUringChannel.AbstractUringUnsafenewUnsafe()Create a newAbstractChannel.AbstractUnsafeinstance which will be used for the life-time of theChannelPeerCredentialspeerCredentials()Returns the unix credentials (uid, gid, pid) of the peer SO_PEERCREDDomainSocketAddressremoteAddress()Returns the remote address where this channel is connected to.protected booleanshouldCompleteReadLoop(int flags, boolean multishot)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.-
Methods inherited from class io.netty.channel.uring.AbstractIoUringStreamChannel
cancelOutstandingReads, cancelOutstandingWrites, doRegister, doShutdownOutput0, isInputShutdown, isOutputShutdown, isShutdown, isStreamSocket, metadata, shutdown, shutdown, shutdownInput, shutdownInput, shutdownOutput, shutdownOutput
-
Methods inherited from class io.netty.channel.uring.AbstractIoUringChannel
autoReadCleared, checkResolvable, doBeginRead, doBind, doClose, doDeregister, doDisconnect, doShutdownOutput, doWrite, fd, isActive, isCompatible, isOpen, localAddress0, newDirectBuffer, newDirectBuffer, nextOpsId, registration, remoteAddress0, resetCachedAddresses, schedulePollRdHup, scheduleWriteIfNeeded, submitAndRunNow
-
Methods inherited from class io.netty.channel.AbstractChannel
closeFuture, compareTo, doRegister, equals, eventLoop, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, maxMessagesPerWrite, newChannelPipeline, newId, parent, pipeline, toString, unsafe, validateFileRegion, voidPromise
-
Methods inherited from class io.netty.util.DefaultAttributeMap
attr, hasAttr
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty.util.AttributeMap
attr, hasAttr
-
Methods inherited from interface io.netty.channel.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, writeAndFlush
-
Methods inherited from interface io.netty.channel.socket.DuplexChannel
isInputShutdown, isOutputShutdown, isShutdown, shutdown, shutdown, shutdownInput, shutdownInput, shutdownOutput, shutdownOutput
-
Methods inherited from interface io.netty.channel.unix.UnixChannel
fd
-
-
-
-
Field Detail
-
config
private final IoUringDomainSocketChannelConfig config
-
local
private volatile DomainSocketAddress local
-
remote
private volatile DomainSocketAddress remote
-
-
Constructor Detail
-
IoUringDomainSocketChannel
public IoUringDomainSocketChannel()
-
IoUringDomainSocketChannel
IoUringDomainSocketChannel(Channel parent, FileDescriptor fd)
-
IoUringDomainSocketChannel
IoUringDomainSocketChannel(Channel parent, LinuxSocket fd)
-
-
Method Detail
-
config
public DomainSocketChannelConfig config()
Description copied from interface:ChannelReturns the configuration of this channel.- Specified by:
configin interfaceChannel- Specified by:
configin interfaceDomainSocketChannel
-
localAddress
public DomainSocketAddress 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 interfaceDomainSocketChannel- Overrides:
localAddressin classAbstractChannel- Returns:
- the local address of this channel.
nullif this channel is not bound.
-
remoteAddress
public DomainSocketAddress 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 interfaceDomainSocketChannel- 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.
-
peerCredentials
public PeerCredentials peerCredentials() throws java.io.IOException
Returns the unix credentials (uid, gid, pid) of the peer SO_PEERCRED- Throws:
java.io.IOException
-
filterOutboundMessage
protected java.lang.Object filterOutboundMessage(java.lang.Object msg)
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 classAbstractIoUringStreamChannel
-
newUnsafe
protected AbstractIoUringChannel.AbstractUringUnsafe newUnsafe()
Description copied from class:AbstractChannelCreate a newAbstractChannel.AbstractUnsafeinstance which will be used for the life-time of theChannel- Overrides:
newUnsafein classAbstractIoUringStreamChannel
-
allowMultiShotPollIn
protected boolean allowMultiShotPollIn()
- Overrides:
allowMultiShotPollInin classAbstractIoUringChannel
-
socketIsEmpty
protected boolean socketIsEmpty(int flags)
Description copied from class:AbstractIoUringChannelReturn if the socket is guaranteed to be empty when the submitted io was executed and the completion event be created.- Overrides:
socketIsEmptyin classAbstractIoUringStreamChannel- Parameters:
flags- the flags that were part of the completion- Returns:
trueif empty.
-
shouldCompleteReadLoop
protected boolean shouldCompleteReadLoop(int flags, boolean multishot)- Overrides:
shouldCompleteReadLoopin classAbstractIoUringStreamChannel
-
isPollInFirst
boolean isPollInFirst()
- Overrides:
isPollInFirstin classAbstractIoUringStreamChannel
-
-