public final class NioDomainSocketChannel extends AbstractNioByteChannel implements DuplexChannel
DuplexChannel which uses NIO selector based implementation to support
UNIX Domain Sockets. This is only supported when using Java 16+.AbstractNioByteChannel.NioByteUnsafeAbstractNioChannel.AbstractNioUnsafe, AbstractNioChannel.NioUnsafeAbstractChannel.AbstractUnsafeChannel.UnsafereadInterestOp| Constructor and Description |
|---|
NioDomainSocketChannel()
Create a new instance
|
NioDomainSocketChannel(Channel parent,
SocketChannel socket)
Create a new instance
|
NioDomainSocketChannel(SelectorProvider provider)
Create a new instance using the given
SelectorProvider. |
NioDomainSocketChannel(SocketChannel socket)
Create a new instance using the given
SocketChannel. |
| Modifier and Type | Method and Description |
|---|---|
ChannelConfig |
config()
Returns the configuration of this channel.
|
protected void |
doBind(SocketAddress localAddress)
Bind the
Channel to the SocketAddress |
protected void |
doClose()
Close the
Channel |
protected boolean |
doConnect(SocketAddress remoteAddress,
SocketAddress localAddress)
Connect to the remote peer
|
protected void |
doDisconnect()
Disconnect this
Channel from its remote peer |
protected void |
doFinishConnect()
Finish the connect
|
protected int |
doReadBytes(ByteBuf byteBuf)
Read bytes into the given
ByteBuf and return the amount. |
protected void |
doShutdownOutput()
Called when conditions justify shutting down the output portion of the channel.
|
protected void |
doWrite(ChannelOutboundBuffer in)
Flush the content of the given buffer to the remote peer.
|
protected int |
doWriteBytes(ByteBuf buf)
|
protected long |
doWriteFileRegion(FileRegion region)
Write a
FileRegion |
boolean |
isActive()
Return
true if the Channel is active and so connected. |
boolean |
isInputShutdown()
Returns
true if and only if the remote peer shut down its output so that no more
data is received from this channel. |
protected boolean |
isInputShutdown0() |
boolean |
isOutputShutdown() |
boolean |
isShutdown()
Determine if both the input and output of this channel have been shutdown.
|
protected SocketChannel |
javaChannel() |
protected SocketAddress |
localAddress0()
Returns the
SocketAddress which is bound locally. |
protected AbstractNioChannel.AbstractNioUnsafe |
newUnsafe()
Create a new
AbstractChannel.AbstractUnsafe instance which will be used for the life-time of the Channel |
ServerChannel |
parent()
Returns the parent of this channel.
|
protected SocketAddress |
remoteAddress0()
Return the
SocketAddress which the Channel is connected to. |
ChannelFuture |
shutdown()
Will shutdown the input and output sides of this channel.
|
ChannelFuture |
shutdown(ChannelPromise promise)
Will shutdown the input and output sides of this channel.
|
ChannelFuture |
shutdownInput()
Shutdown the input side of the channel.
|
ChannelFuture |
shutdownInput(ChannelPromise promise)
Will shutdown the input and notify
ChannelPromise. |
ChannelFuture |
shutdownOutput() |
ChannelFuture |
shutdownOutput(ChannelPromise promise)
Will shutdown the output and notify
ChannelPromise. |
clearOpWrite, doWrite0, filterOutboundMessage, incompleteWrite, metadata, setOpWriteclearReadPending, doBeginRead, doDeregister, doRegister, eventLoop, isCompatible, isOpen, isReadPending, newDirectBuffer, newDirectBuffer, selectionKey, setReadPending, unsafealloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, equals, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, remoteAddress, toString, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlushattr, hasAttrclone, finalize, getClass, notify, notifyAll, wait, wait, waitalloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isOpen, isRegistered, isWritable, localAddress, metadata, pipeline, read, remoteAddress, unsafeattr, hasAttrbind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlushcompareTopublic NioDomainSocketChannel()
public NioDomainSocketChannel(SelectorProvider provider)
SelectorProvider.public NioDomainSocketChannel(SocketChannel socket)
SocketChannel.public NioDomainSocketChannel(Channel parent, SocketChannel socket)
parent - the Channel which created this instance or null if it was created by the usersocket - the SocketChannel which will be usedpublic ServerChannel parent()
Channelparent in interface Channelparent in class AbstractChannelnull if this channel does not have a parent channel.public ChannelConfig config()
Channelprotected SocketChannel javaChannel()
javaChannel in class AbstractNioChannelpublic boolean isActive()
Channeltrue if the Channel is active and so connected.public boolean isOutputShutdown()
isOutputShutdown in interface DuplexChannelSocket.isOutputShutdown()public boolean isInputShutdown()
DuplexChanneltrue if and only if the remote peer shut down its output so that no more
data is received from this channel. Note that the semantic of this method is different from
that of Socket.shutdownInput() and Socket.isInputShutdown().isInputShutdown in interface DuplexChannelpublic boolean isShutdown()
DuplexChannelisShutdown in interface DuplexChannelprotected void doShutdownOutput()
throws Exception
AbstractChanneldoShutdownOutput in class AbstractChannelExceptionpublic ChannelFuture shutdownOutput()
shutdownOutput in interface DuplexChannelSocket.shutdownOutput()public ChannelFuture shutdownOutput(ChannelPromise promise)
DuplexChannelChannelPromise.shutdownOutput in interface DuplexChannelSocket.shutdownOutput()public ChannelFuture shutdownInput()
AbstractNioByteChannelshutdownInput in interface DuplexChannelshutdownInput in class AbstractNioByteChannelSocket.shutdownInput()protected boolean isInputShutdown0()
isInputShutdown0 in class AbstractNioByteChannelpublic ChannelFuture shutdownInput(ChannelPromise promise)
DuplexChannelChannelPromise.shutdownInput in interface DuplexChannelSocket.shutdownInput()public ChannelFuture shutdown()
DuplexChannelshutdown in interface DuplexChannelpublic ChannelFuture shutdown(ChannelPromise promise)
DuplexChannelshutdown in interface DuplexChannelpromise - will be completed when both shutdown operations complete.protected SocketAddress localAddress0()
AbstractChannelSocketAddress which is bound locally.localAddress0 in class AbstractChannelprotected SocketAddress remoteAddress0()
AbstractChannelSocketAddress which the Channel is connected to.remoteAddress0 in class AbstractChannelprotected void doBind(SocketAddress localAddress) throws Exception
AbstractChannelChannel to the SocketAddressdoBind in class AbstractChannelExceptionprotected boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception
AbstractNioChanneldoConnect in class AbstractNioChannelExceptionprotected void doFinishConnect()
throws Exception
AbstractNioChanneldoFinishConnect in class AbstractNioChannelExceptionprotected void doDisconnect()
throws Exception
AbstractChannelChannel from its remote peerdoDisconnect in class AbstractChannelExceptionprotected void doClose()
throws Exception
AbstractChannelChanneldoClose in class AbstractNioChannelExceptionprotected int doReadBytes(ByteBuf byteBuf) throws Exception
AbstractNioByteChannelByteBuf and return the amount.doReadBytes in class AbstractNioByteChannelExceptionprotected int doWriteBytes(ByteBuf buf) throws Exception
AbstractNioByteChanneldoWriteBytes in class AbstractNioByteChannelbuf - the ByteBuf from which the bytes should be writtenExceptionprotected long doWriteFileRegion(FileRegion region) throws Exception
AbstractNioByteChannelFileRegiondoWriteFileRegion in class AbstractNioByteChannelregion - the FileRegion from which the bytes should be writtenExceptionprotected void doWrite(ChannelOutboundBuffer in) throws Exception
AbstractChanneldoWrite in class AbstractNioByteChannelExceptionprotected AbstractNioChannel.AbstractNioUnsafe newUnsafe()
AbstractChannelAbstractChannel.AbstractUnsafe instance which will be used for the life-time of the ChannelnewUnsafe in class AbstractNioByteChannelCopyright © 2008–2025 The Netty Project. All rights reserved.