@UnstableApi public final class KQueueDomainSocketChannel extends AbstractKQueueStreamChannel implements DomainSocketChannel
Modifier and Type | Class and Description |
---|---|
private class |
KQueueDomainSocketChannel.KQueueDomainUnsafe |
AbstractKQueueStreamChannel.KQueueStreamUnsafe
AbstractKQueueChannel.AbstractKQueueUnsafe
AbstractChannel.AbstractUnsafe
Channel.Unsafe
Modifier and Type | Field and Description |
---|---|
private KQueueDomainSocketChannelConfig |
config |
private DomainSocketAddress |
local |
private DomainSocketAddress |
remote |
active, inputClosedSeenErrorOnRead, jniSelfPtr, readReadyRunnablePending, socket
Constructor and Description |
---|
KQueueDomainSocketChannel() |
KQueueDomainSocketChannel(Channel parent,
BsdSocket fd) |
KQueueDomainSocketChannel(int fd) |
Modifier and Type | Method and Description |
---|---|
KQueueDomainSocketChannelConfig |
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 AbstractKQueueChannel.AbstractKQueueUnsafe |
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
checkResolvable, clearReadFilter, doBeginRead, doDeregister, doDisconnect, doReadBytes, doRegister, doWriteBytes, fd, isActive, isAllowHalfClosure, isCompatible, isOpen, isSoErrorZero, newDirectBuffer, newDirectBuffer, readFilter, shouldBreakReadReady, writeFilter
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 KQueueDomainSocketChannelConfig config
private volatile DomainSocketAddress local
private volatile DomainSocketAddress remote
public KQueueDomainSocketChannel()
public KQueueDomainSocketChannel(int fd)
protected AbstractKQueueChannel.AbstractKQueueUnsafe newUnsafe()
AbstractChannel
AbstractChannel.AbstractUnsafe
instance which will be used for the life-time of the Channel
newUnsafe
in class AbstractKQueueStreamChannel
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 KQueueDomainSocketChannelConfig config()
Channel
config
in interface Channel
config
in interface DomainSocketChannel
config
in class AbstractKQueueChannel
protected boolean doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress) throws java.lang.Exception
AbstractKQueueStreamChannel
doConnect
in class AbstractKQueueStreamChannel
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 AbstractKQueueStreamChannel
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 AbstractKQueueStreamChannel
@UnstableApi public PeerCredentials peerCredentials() throws java.io.IOException
java.io.IOException