public final class EpollDomainSocketChannel extends AbstractEpollStreamChannel implements DomainSocketChannel
Modifier and Type | Class and Description |
---|---|
private class |
EpollDomainSocketChannel.EpollDomainUnsafe |
AbstractEpollStreamChannel.EpollStreamUnsafe, AbstractEpollStreamChannel.SpliceInTask
AbstractEpollChannel.AbstractEpollUnsafe
AbstractChannel.AbstractUnsafe
Channel.Unsafe
Modifier and Type | Field and Description |
---|---|
private EpollDomainSocketChannelConfig |
config |
private DomainSocketAddress |
local |
private DomainSocketAddress |
remote |
active, epollInReadyRunnablePending, flags, inputClosedSeenErrorOnRead, socket
Constructor and Description |
---|
EpollDomainSocketChannel() |
EpollDomainSocketChannel(Channel parent,
FileDescriptor fd) |
EpollDomainSocketChannel(Channel parent,
LinuxSocket fd) |
EpollDomainSocketChannel(int fd) |
EpollDomainSocketChannel(int fd,
boolean active) |
Modifier and Type | Method and Description |
---|---|
EpollDomainSocketChannelConfig |
config()
Returns the configuration of this channel.
|
protected void |
doBind(java.net.SocketAddress localAddress)
Bind the
Channel to the SocketAddress |
protected boolean |
doConnect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
Connect to the remote peer
|
protected boolean |
doWriteSingle(ChannelOutboundBuffer in,
int writeSpinCount) |
protected java.lang.Object |
filterOutboundMessage(java.lang.Object msg)
Invoked when a new message is added to a
ChannelOutboundBuffer of this AbstractChannel , so that
the Channel implementation converts the message to another. |
DomainSocketAddress |
localAddress()
Returns the local address where this channel is bound to.
|
protected DomainSocketAddress |
localAddress0()
Returns the
SocketAddress which is bound locally. |
protected AbstractEpollChannel.AbstractEpollUnsafe |
newUnsafe()
Create a new
AbstractChannel.AbstractUnsafe instance which will be used for the life-time of the Channel |
PeerCredentials |
peerCredentials()
Returns the unix credentials (uid, gid, pid) of the peer
SO_PEERCRED
|
DomainSocketAddress |
remoteAddress()
Returns the remote address where this channel is connected to.
|
protected DomainSocketAddress |
remoteAddress0()
Return the
SocketAddress which the Channel is connected to. |
doClose, doWrite, isInputShutdown, isOutputShutdown, isShutdown, metadata, shutdown, shutdown, shutdownInput, shutdownInput, shutdownOutput, shutdownOutput, spliceTo, spliceTo, spliceTo, spliceTo
checkResolvable, clearEpollIn, clearFlag, doBeginRead, doDeregister, doDisconnect, doReadBytes, doRegister, doWriteBytes, fd, isActive, isAllowHalfClosure, isCompatible, isFlagSet, isOpen, isSoErrorZero, newDirectBuffer, newDirectBuffer, setFlag, shouldBreakEpollInReady
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, equals, eventLoop, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlush
attr, hasAttr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
fd
isInputShutdown, isOutputShutdown, isShutdown, shutdown, shutdown, shutdownInput, shutdownInput, shutdownOutput, shutdownOutput
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isActive, isOpen, isRegistered, isWritable, metadata, parent, pipeline, read, unsafe
attr, hasAttr
bind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlush
private final EpollDomainSocketChannelConfig config
private volatile DomainSocketAddress local
private volatile DomainSocketAddress remote
public EpollDomainSocketChannel()
EpollDomainSocketChannel(Channel parent, FileDescriptor fd)
public EpollDomainSocketChannel(int fd)
public EpollDomainSocketChannel(Channel parent, LinuxSocket fd)
public EpollDomainSocketChannel(int fd, boolean active)
protected AbstractEpollChannel.AbstractEpollUnsafe newUnsafe()
AbstractChannel
AbstractChannel.AbstractUnsafe
instance which will be used for the life-time of the Channel
newUnsafe
in class AbstractEpollStreamChannel
protected DomainSocketAddress localAddress0()
AbstractChannel
SocketAddress
which is bound locally.localAddress0
in class AbstractChannel
protected DomainSocketAddress remoteAddress0()
AbstractChannel
SocketAddress
which the Channel
is connected to.remoteAddress0
in class AbstractChannel
protected void doBind(java.net.SocketAddress localAddress) throws java.lang.Exception
AbstractChannel
Channel
to the SocketAddress
doBind
in class AbstractChannel
java.lang.Exception
public EpollDomainSocketChannelConfig config()
Channel
config
in interface Channel
config
in interface DomainSocketChannel
config
in class AbstractEpollChannel
protected boolean doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress) throws java.lang.Exception
AbstractEpollStreamChannel
doConnect
in class AbstractEpollStreamChannel
java.lang.Exception
public DomainSocketAddress remoteAddress()
Channel
SocketAddress
is supposed to be down-cast into more
concrete type such as InetSocketAddress
to retrieve the detailed
information.remoteAddress
in interface Channel
remoteAddress
in interface DomainSocketChannel
remoteAddress
in class AbstractChannel
null
if this channel is not connected.
If this channel is not connected but it can receive messages
from arbitrary remote addresses (e.g. DatagramChannel
,
use DefaultAddressedEnvelope.recipient()
to determine
the origination of the received message as this method will
return null
.public DomainSocketAddress localAddress()
Channel
SocketAddress
is supposed to be down-cast into more concrete
type such as InetSocketAddress
to retrieve the detailed
information.localAddress
in interface Channel
localAddress
in interface DomainSocketChannel
localAddress
in class AbstractChannel
null
if this channel is not bound.protected boolean doWriteSingle(ChannelOutboundBuffer in, int writeSpinCount) throws java.lang.Exception
doWriteSingle
in class AbstractEpollStreamChannel
java.lang.Exception
protected java.lang.Object filterOutboundMessage(java.lang.Object msg)
AbstractChannel
ChannelOutboundBuffer
of this AbstractChannel
, so that
the Channel
implementation converts the message to another. (e.g. heap buffer -> direct buffer)filterOutboundMessage
in class AbstractEpollStreamChannel
@UnstableApi public PeerCredentials peerCredentials() throws java.io.IOException
java.io.IOException