public abstract class AbstractEpollStreamChannel extends AbstractChannel implements DuplexChannel
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractEpollStreamChannel.SpliceInTask |
AbstractChannel.AbstractUnsafeChannel.Unsafe| Modifier and Type | Field and Description |
|---|---|
protected boolean |
active |
protected int |
flags |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEpollStreamChannel(Channel parent, int fd) |
protected |
AbstractEpollStreamChannel(int fd) |
protected |
AbstractEpollStreamChannel(io.netty.channel.epoll.LinuxSocket fd, boolean active) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkResolvable(java.net.InetSocketAddress addr) |
abstract EpollChannelConfig |
config()
返回此频道的配置。
|
protected void |
doBeginRead()
安排读取操作。
|
protected void |
doBind(java.net.SocketAddress local)
将 Channel绑定到SocketAddress
|
protected void |
doClose()
关闭 Channel
|
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 void |
doShutdownOutput()
当条件证明关闭通道的输出部分时调用。
|
protected void |
doWrite(ChannelOutboundBuffer in)
将给定缓冲区的内容刷新到远程对等体。
|
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 |
isInputShutdown()
返回
true当且仅当远程节点关闭其输出,以便从此通道接收不到更多数据时。
|
boolean |
isOpen()
如果 Channel已打开并且稍后可能会激活,则返回true
|
boolean |
isOutputShutdown() |
boolean |
isShutdown()
确定此通道的输入和输出是否都已关闭。
|
protected java.net.SocketAddress |
localAddress0()
返回本地绑定的
SocketAddress 。
|
ChannelMetadata |
metadata()
返回 ChannelMetadata的的Channel其描述的性质Channel 。
|
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的生命周期
|
protected java.net.SocketAddress |
remoteAddress0()
返回 SocketAddress其中Channel被连接到。
|
ChannelFuture |
shutdown()
将关闭此通道的输入和输出端。
|
ChannelFuture |
shutdown(ChannelPromise promise)
将关闭此通道的输入和输出端。
|
ChannelFuture |
shutdownInput() |
ChannelFuture |
shutdownInput(ChannelPromise promise)
将关闭输入并通知 ChannelPromise 。
|
ChannelFuture |
shutdownOutput() |
ChannelFuture |
shutdownOutput(ChannelPromise promise)
将关闭输出并通知 ChannelPromise 。
|
ChannelFuture |
spliceTo(AbstractEpollStreamChannel ch, int len)
|
ChannelFuture |
spliceTo(AbstractEpollStreamChannel ch, int len, ChannelPromise promise)
|
ChannelFuture |
spliceTo(FileDescriptor ch, int offset, int len)
|
ChannelFuture |
spliceTo(FileDescriptor ch, int offset, int len, ChannelPromise promise)
|
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, localAddress, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushattr, hasAttrclone, finalize, getClass, notify, notifyAll, wait, wait, waitalloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, config, eventLoop, flush, id, isActive, isOpen, isRegistered, isWritable, localAddress, parent, pipeline, read, remoteAddress, unsafeattr, hasAttrbind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlushprotected AbstractEpollStreamChannel(Channel parent, int fd)
protected AbstractEpollStreamChannel(int fd)
protected AbstractEpollStreamChannel(io.netty.channel.epoll.LinuxSocket fd,
boolean active) protected io.netty.channel.epoll.AbstractEpollChannel.AbstractEpollUnsafe newUnsafe()
AbstractChannel
AbstractChannel.AbstractUnsafe实例,该实例将用于Channel的生命周期
public ChannelMetadata metadata()
Channel
ChannelMetadata的的Channel其描述的性质Channel 。
public final ChannelFuture spliceTo(AbstractEpollStreamChannel ch, int len)
AbstractEpollStreamChannel拼接到另一个AbstractEpollStreamChannel 。
len是要拼接的字节数。
如果使用Integer.MAX_VALUE它将拼接,直到ChannelFuture被取消或失败。
请注意:
EventLoop ,否则会引发IllegalArgumentException 。 EpollChannelConfig.getEpollMode()必须是EpollMode.LEVEL_TRIGGERED为此和目标AbstractEpollStreamChannel public final ChannelFuture spliceTo(AbstractEpollStreamChannel ch, int len, ChannelPromise promise)
AbstractEpollStreamChannel拼接到另一个AbstractEpollStreamChannel 。
len是要拼接的字节数。
如果使用Integer.MAX_VALUE ,它将拼接,直到ChannelFuture被取消或失败。
请注意:
EventLoop ,否则会引发IllegalArgumentException 。 EpollChannelConfig.getEpollMode()必须是EpollMode.LEVEL_TRIGGERED这个和目标AbstractEpollStreamChannel public final ChannelFuture spliceTo(FileDescriptor ch, int offset, int len)
AbstractEpollStreamChannel拼接到另一个FileDescriptor 。
该offset针对偏移FileDescriptor和len是字节拼接的数量。
如果使用Integer.MAX_VALUE它将拼接,直到ChannelFuture被取消或失败。
请注意:
EpollChannelConfig.getEpollMode()必须是EpollMode.LEVEL_TRIGGERED这个AbstractEpollStreamChannel ChannelFuture通知后, FileDescriptor将不会关闭 IllegalStateException将被抛出。 public final ChannelFuture spliceTo(FileDescriptor ch, int offset, int len, ChannelPromise promise)
AbstractEpollStreamChannel与另一个FileDescriptor拼接 。
该offset针对偏移FileDescriptor和len是字节拼接的数量。
如果使用Integer.MAX_VALUE ,它将拼接,直到ChannelFuture被取消或失败。
请注意:
EpollChannelConfig.getEpollMode()必须EpollMode.LEVEL_TRIGGERED这个AbstractEpollStreamChannel FileDescriptor后不会被关闭ChannelPromise通知 IllegalStateException将被抛出。 protected void doWrite(ChannelOutboundBuffer in) throws java.lang.Exception
AbstractChannel
doWrite在课堂上
AbstractChannel
java.lang.Exception
protected int doWriteSingle(ChannelOutboundBuffer in) throws java.lang.Exception
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
protected final void doShutdownOutput()
throws java.lang.Exception
AbstractChannel
doShutdownOutput在课程
AbstractChannel
java.lang.Exception
public boolean isOutputShutdown()
isOutputShutdown在界面
DuplexChannel
Socket.isOutputShutdown()
public boolean isInputShutdown()
DuplexChannel复制的描述
true当且仅当远程节点关闭其输出,以便从此通道接收不到更多数据时。
请注意,此方法的语义不同于Socket.shutdownInput()和Socket.isInputShutdown() 。
isInputShutdown接口
DuplexChannel
public boolean isShutdown()
DuplexChannel复制的描述
isShutdown在界面
DuplexChannel
public ChannelFuture shutdownOutput()
shutdownOutput在界面
DuplexChannel
Socket.shutdownOutput()
public ChannelFuture shutdownOutput(ChannelPromise promise)
DuplexChannel
ChannelPromise 。
shutdownOutput接口
DuplexChannel
Socket.shutdownOutput()
public ChannelFuture shutdownInput()
shutdownInput在界面
DuplexChannel
Socket.shutdownInput()
public ChannelFuture shutdownInput(ChannelPromise promise)
DuplexChannel
ChannelPromise 。
shutdownInput在界面
DuplexChannel
Socket.shutdownInput()
public ChannelFuture shutdown()
DuplexChannel
shutdown在界面
DuplexChannel
public ChannelFuture shutdown(ChannelPromise promise)
DuplexChannel复制的描述
shutdown在界面
DuplexChannel
promise - 将在两次关机操作完成时完成。
protected void doClose()
throws java.lang.Exception
AbstractChannel
Channel
java.lang.Exception
public final FileDescriptor fd()
UnixChannel复制的描述
Channel使用的FileDescriptor 。
fd在界面
UnixChannel
public abstract EpollChannelConfig config()
Channel复制的描述
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
protected void doBind(java.net.SocketAddress local)
throws java.lang.Exception
AbstractChannel
Channel绑定到SocketAddress
doBind的
AbstractChannel
java.lang.Exception
protected boolean doConnect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
throws java.lang.Exception
java.lang.Exception
protected java.net.SocketAddress localAddress0()
AbstractChannel
SocketAddress 。
localAddress0在课堂上
AbstractChannel
protected java.net.SocketAddress remoteAddress0()
AbstractChannel
SocketAddress其中Channel被连接到。
remoteAddress0 in class
AbstractChannel
Copyright © 2008–2018 The Netty Project. All rights reserved.