public final class EpollDomainSocketChannel extends AbstractEpollStreamChannel implements DomainSocketChannel
AbstractEpollStreamChannel.SpliceInTask
AbstractChannel.AbstractUnsafe
Channel.Unsafe
Modifier and Type | Field and Description |
---|---|
protected boolean |
active |
protected int |
flags |
Constructor and Description |
---|
EpollDomainSocketChannel() |
EpollDomainSocketChannel(Channel parent, io.netty.channel.epoll.LinuxSocket fd) |
EpollDomainSocketChannel(int fd) |
EpollDomainSocketChannel(int fd, boolean active) |
Modifier and Type | Method and Description |
---|---|
protected static void |
checkResolvable(java.net.InetSocketAddress addr) |
EpollDomainSocketChannelConfig |
config()
返回此频道的配置。
|
protected void |
doBeginRead()
安排读取操作。
|
protected void |
doBind(java.net.SocketAddress localAddress)
将 Channel 绑定到SocketAddress
|
protected boolean |
doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
连接到远程对等
|
protected void |
doDeregister()
|
protected void |
doDisconnect()
将此 Channel 从其远程对等方断开
|
protected int |
doReadBytes(ByteBuf byteBuf)
将字节读入给定的 ByteBuf 并返回金额。
|
protected void |
doRegister()
|
protected int |
doWriteBytes(ChannelOutboundBuffer in, ByteBuf buf) |
protected int |
doWriteSingle(ChannelOutboundBuffer in)
尝试编写单个对象。
|
FileDescriptor |
fd()
返回 Channel 使用的FileDescriptor 。
|
protected java.lang.Object |
filterOutboundMessage(java.lang.Object msg)
当新消息添加到此 AbstractChannel 的ChannelOutboundBuffer 中时调用 ,以便Channel 实现将消息转换为另一个消息。
|
boolean |
isActive()
如果 Channel 处于活动状态并已连接,则返回true 。
|
protected boolean |
isCompatible(EventLoop loop)
如果给定 EventLoop 与此实例兼容,则返回true 。
|
boolean |
isOpen()
如果 Channel 已打开并且稍后可能会激活,则返回true
|
DomainSocketAddress |
localAddress()
返回此通道绑定的本地地址。
|
protected DomainSocketAddress |
localAddress0()
返回本地绑定的
SocketAddress 。
|
protected ByteBuf |
newDirectBuffer(ByteBuf buf)
返回指定 ByteBuf 的堆外副本,并释放原始副本。
|
protected ByteBuf |
newDirectBuffer(java.lang.Object holder, ByteBuf buf)
返回指定 ByteBuf 的堆外副本,并释放指定的持有者。
|
protected io.netty.channel.epoll.AbstractEpollChannel.AbstractEpollUnsafe |
newUnsafe()
创建一个新的 AbstractChannel.AbstractUnsafe 实例,该实例将用于Channel 的生命周期
|
PeerCredentials |
peerCredentials()
返回对等
SO_PEERCRED的unix凭据(uid,gid,pid)
|
DomainSocketAddress |
remoteAddress()
返回此通道连接到的远程地址。
|
protected DomainSocketAddress |
remoteAddress0()
返回 SocketAddress 其中Channel 被连接到。
|
doClose, doShutdownOutput, doWrite, isInputShutdown, isOutputShutdown, isShutdown, metadata, shutdown, shutdown, shutdownInput, shutdownInput, shutdownOutput, shutdownOutput, spliceTo, spliceTo, spliceTo, spliceTo
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
public EpollDomainSocketChannel()
public EpollDomainSocketChannel(int fd)
public EpollDomainSocketChannel(Channel parent, io.netty.channel.epoll.LinuxSocket fd)
public EpollDomainSocketChannel(int fd, boolean active)
protected io.netty.channel.epoll.AbstractEpollChannel.AbstractEpollUnsafe newUnsafe()
AbstractChannel
AbstractChannel.AbstractUnsafe
实例,该实例将用于Channel
的生命周期
protected DomainSocketAddress localAddress0()
AbstractChannel
SocketAddress
。
protected DomainSocketAddress remoteAddress0()
AbstractChannel
SocketAddress
其中Channel
被连接到。
protected void doBind(java.net.SocketAddress localAddress) throws java.lang.Exception
AbstractChannel
Channel
绑定到SocketAddress
java.lang.Exception
public EpollDomainSocketChannelConfig config()
Channel
复制的描述
config
接口
Channel
config
接口
DomainSocketChannel
protected boolean doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress) throws java.lang.Exception
java.lang.Exception
public DomainSocketAddress remoteAddress()
Channel
复制的描述
SocketAddress
被假定为更具体的类型,如InetSocketAddress
以检索详细信息。
remoteAddress
接口
Channel
remoteAddress
接口
DomainSocketChannel
remoteAddress
在课堂
AbstractChannel
null
如果此通道未连接。
如果此通道未连接,但它可以接收来自任意远程地址的消息(例如DatagramChannel
,请使用DefaultAddressedEnvelope.recipient()
来确定收到消息的来源,因为此方法将返回null
。
public DomainSocketAddress localAddress()
Channel
复制的描述
SocketAddress
应该被下调为更具体的类型,例如InetSocketAddress
以检索详细信息。
localAddress
接口
Channel
localAddress
接口
DomainSocketChannel
localAddress
在课堂
AbstractChannel
null
如果此通道未绑定。
protected int doWriteSingle(ChannelOutboundBuffer in) throws java.lang.Exception
AbstractEpollStreamChannel
doWriteSingle
在课堂
AbstractEpollStreamChannel
in
- 包含要写入对象的集合。
ChannelConfig.getWriteSpinCount()
。
典型的用例如下:
ByteBuf
(或其他空的内容),这是合适的 ChannelUtils.WRITE_STATUS_SNDBUF_FULL
- 如果尝试向操作系统写入数据,但未接受任何数据 java.lang.Exception
- 如果发生I / O错误。
protected java.lang.Object filterOutboundMessage(java.lang.Object msg)
AbstractChannel
AbstractChannel
的ChannelOutboundBuffer
时调用 ,以便Channel
实现将消息转换为另一个消息。
(例如堆缓冲区 - >直接缓冲区)
@UnstableApi public PeerCredentials peerCredentials() throws java.io.IOException
java.io.IOException
public final FileDescriptor fd()
UnixChannel
Channel
使用的FileDescriptor
。
fd
在界面
UnixChannel
protected void doDisconnect() throws java.lang.Exception
AbstractChannel
Channel
从其远程对等方断开
doDisconnect
在班级
AbstractChannel
java.lang.Exception
protected boolean isCompatible(EventLoop loop)
AbstractChannel
EventLoop
与此实例兼容,则返回true
。
isCompatible
在课堂上
AbstractChannel
protected void doDeregister() throws java.lang.Exception
AbstractChannel
doDeregister
在课堂
AbstractChannel
java.lang.Exception
protected final void doBeginRead() throws java.lang.Exception
AbstractChannel
doBeginRead
在课堂
AbstractChannel
java.lang.Exception
protected void doRegister() throws java.lang.Exception
AbstractChannel
doRegister
在课堂
AbstractChannel
java.lang.Exception
protected static void checkResolvable(java.net.InetSocketAddress addr)
protected final int doReadBytes(ByteBuf byteBuf) throws java.lang.Exception
ByteBuf
并返回金额。
java.lang.Exception
protected final int doWriteBytes(ChannelOutboundBuffer in, ByteBuf buf) throws java.lang.Exception
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.