public final class EpollSocketChannel extends AbstractEpollStreamChannel implements SocketChannel
SocketChannel使用linux EPOLL Edge-Triggered Mode实现最高性能。
AbstractEpollStreamChannel.SpliceInTaskAbstractChannel.AbstractUnsafeChannel.Unsafe| Modifier and Type | Field and Description |
|---|---|
protected boolean |
active |
protected int |
flags |
| Constructor and Description |
|---|
EpollSocketChannel() |
EpollSocketChannel(int fd) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkResolvable(java.net.InetSocketAddress addr) |
EpollSocketChannelConfig |
config()
返回此频道的配置。
|
protected void |
doBeginRead()
安排读取操作。
|
protected void |
doBind(java.net.SocketAddress local)
将 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) |
FileDescriptor |
fd()
返回此 Channel使用的FileDescriptor 。
|
boolean |
isActive()
如果 Channel处于活动状态并已连接,则返回true 。
|
protected boolean |
isCompatible(EventLoop loop)
如果给定的 EventLoop与此实例兼容,则返回true 。
|
boolean |
isOpen()
如果 Channel已打开并且稍后可能会激活,则返回true
|
java.net.InetSocketAddress |
localAddress()
返回此通道绑定的本地地址。
|
protected java.net.SocketAddress |
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的生命周期
|
ServerSocketChannel |
parent()
返回此频道的父级。
|
java.net.InetSocketAddress |
remoteAddress()
返回此通道连接到的远程地址。
|
protected java.net.SocketAddress |
remoteAddress0()
返回 SocketAddress其中Channel被连接到。
|
EpollTcpInfo |
tcpInfo()
返回当前套接字的
TCP_INFO 。
|
EpollTcpInfo |
tcpInfo(EpollTcpInfo info)
更新并返回当前套接字的
TCP_INFO 。
|
doClose, doShutdownOutput, doWrite, doWriteSingle, filterOutboundMessage, isInputShutdown, isOutputShutdown, isShutdown, metadata, shutdown, shutdown, shutdownInput, shutdownInput, shutdownOutput, shutdownOutput, spliceTo, spliceTo, spliceTo, spliceToalloc, 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, pipeline, read, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushattr, hasAttrclone, finalize, getClass, notify, notifyAll, wait, wait, waitisInputShutdown, isOutputShutdown, isShutdown, shutdown, shutdown, shutdownInput, shutdownInput, shutdownOutput, shutdownOutputalloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isActive, isOpen, isRegistered, isWritable, metadata, pipeline, read, unsafeattr, hasAttrbind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlushpublic EpollSocketChannel()
public EpollSocketChannel(int fd)
public EpollTcpInfo tcpInfo()
TCP_INFO 。
见man 7 tcp 。
public EpollTcpInfo tcpInfo(EpollTcpInfo info)
TCP_INFO 。
见man 7 tcp 。
public java.net.InetSocketAddress remoteAddress()
Channel
SocketAddress被假定为更具体的类型,如InetSocketAddress以检索详细信息。
remoteAddress在界面
Channel
remoteAddress接口
SocketChannel
remoteAddress在类
AbstractChannel
null如果此通道未连接。
如果此通道未连接,但它可以接收来自任意远程地址的消息(例如DatagramChannel ,请使用DefaultAddressedEnvelope.recipient()确定收到消息的来源,因为此方法将返回null 。
public java.net.InetSocketAddress localAddress()
Channel
SocketAddress应该被转换为更具体的类型,例如InetSocketAddress以检索详细信息。
localAddress在界面
Channel
localAddress在界面
SocketChannel
localAddress类
AbstractChannel
null如果此通道未绑定。
public EpollSocketChannelConfig config()
Channel
config ,界面
Channel
config ,界面
SocketChannel
public ServerSocketChannel parent()
Channel
parent在界面
Channel
parent在界面
SocketChannel
parent在类
AbstractChannel
null如果此频道没有父频道。
protected io.netty.channel.epoll.AbstractEpollChannel.AbstractEpollUnsafe newUnsafe()
AbstractChannel
AbstractChannel.AbstractUnsafe实例,该实例将用于Channel的生命周期
newUnsafe在课堂上
AbstractEpollStreamChannel
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
protected void doBind(java.net.SocketAddress local)
throws java.lang.Exception
AbstractChannel
Channel绑定到SocketAddress
doBind class
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在课堂上
AbstractChannel
Copyright © 2008–2018 The Netty Project. All rights reserved.