public final class EpollDatagramChannel extends AbstractChannel implements DatagramChannel
DatagramChannel
使用linux EPOLL Edge-Triggered Mode实现最高性能。
AbstractChannel.AbstractUnsafe
Channel.Unsafe
Modifier and Type | Field and Description |
---|---|
protected boolean |
active |
protected int |
flags |
Constructor and Description |
---|
EpollDatagramChannel() |
EpollDatagramChannel(int fd) |
Modifier and Type | Method and Description |
---|---|
ChannelFuture |
block(java.net.InetAddress multicastAddress, java.net.InetAddress sourceToBlock)
阻止给定多播地址的给定sourceToBlock地址,并在操作完成后通知 ChannelFuture 。
|
ChannelFuture |
block(java.net.InetAddress multicastAddress, java.net.InetAddress sourceToBlock, ChannelPromise promise)
阻止给定多播地址的给定sourceToBlock地址,并在操作完成后通知 ChannelFuture 。
|
ChannelFuture |
block(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress sourceToBlock)
在给定networkInterface上阻止给定的多播地址的给定sourceToBlock地址,并在操作完成后通知 ChannelFuture 。
|
ChannelFuture |
block(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress sourceToBlock, ChannelPromise promise)
在给定networkInterface上阻止给定的多播地址的给定sourceToBlock地址,并在操作完成后通知 ChannelFuture 。
|
protected static void |
checkResolvable(java.net.InetSocketAddress addr) |
EpollDatagramChannelConfig |
config()
返回此频道的配置。
|
protected void |
doBeginRead()
安排读取操作。
|
protected void |
doBind(java.net.SocketAddress localAddress)
将 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 |
doWrite(ChannelOutboundBuffer in)
将给定缓冲区的内容刷新到远程对等体。
|
protected int |
doWriteBytes(ChannelOutboundBuffer in, ByteBuf buf) |
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 |
isConnected()
如果 DatagramChannel 连接到远程对等端,则返回true 。
|
boolean |
isOpen()
如果 Channel 已打开并且稍后可能会激活,则返回true
|
ChannelFuture |
joinGroup(java.net.InetAddress multicastAddress)
加入多播组,并在操作完成后通知 ChannelFuture 。
|
ChannelFuture |
joinGroup(java.net.InetAddress multicastAddress, ChannelPromise promise)
加入一个多播组,并在操作完成后通知 ChannelFuture 。
|
ChannelFuture |
joinGroup(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress source)
在指定的接口加入指定的组播组,并在操作完成后通知 ChannelFuture 。
|
ChannelFuture |
joinGroup(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress source, ChannelPromise promise)
在指定的接口加入指定的组播组,并在操作完成后通知 ChannelFuture 。
|
ChannelFuture |
joinGroup(java.net.InetSocketAddress multicastAddress, java.net.NetworkInterface networkInterface)
在指定的接口加入指定的组播组,并在操作完成后通知 ChannelFuture 。
|
ChannelFuture |
joinGroup(java.net.InetSocketAddress multicastAddress, java.net.NetworkInterface networkInterface, ChannelPromise promise)
在指定的接口加入指定的组播组,并在操作完成后通知 ChannelFuture 。
|
ChannelFuture |
leaveGroup(java.net.InetAddress multicastAddress)
一旦操作完成,就离开多播组并通知 ChannelFuture 。
|
ChannelFuture |
leaveGroup(java.net.InetAddress multicastAddress, ChannelPromise promise)
一旦操作完成,就离开多播组并通知 ChannelFuture 。
|
ChannelFuture |
leaveGroup(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress source)
在指定的接口上使用指定的源保留指定的多播组,并在操作完成后通知 ChannelFuture 。
|
ChannelFuture |
leaveGroup(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress source, ChannelPromise promise)
在指定的接口上使用指定的源保留指定的多播组,并在操作完成后通知 ChannelFuture 。
|
ChannelFuture |
leaveGroup(java.net.InetSocketAddress multicastAddress, java.net.NetworkInterface networkInterface)
在指定的本地接口上留下多播组,并在操作完成后通知 ChannelFuture 。
|
ChannelFuture |
leaveGroup(java.net.InetSocketAddress multicastAddress, java.net.NetworkInterface networkInterface, ChannelPromise promise)
在指定的本地接口上留下多播组,并在操作完成后通知 ChannelFuture 。
|
java.net.InetSocketAddress |
localAddress()
返回此通道绑定的本地地址。
|
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 的生命周期
|
java.net.InetSocketAddress |
remoteAddress()
返回此通道连接到的远程地址。
|
protected java.net.SocketAddress |
remoteAddress0()
返回 SocketAddress 其中Channel 被连接到。
|
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doShutdownOutput, 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
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isOpen, isRegistered, isWritable, 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 EpollDatagramChannel()
public EpollDatagramChannel(int fd)
public java.net.InetSocketAddress remoteAddress()
Channel
SocketAddress
应该被下调为更具体的类型,例如InetSocketAddress
以检索详细信息。
remoteAddress
在界面
Channel
remoteAddress
在界面
DatagramChannel
remoteAddress
在课堂
AbstractChannel
null
。
如果此通道未连接,但它可以接收来自任意远程地址的消息(例如DatagramChannel
,请使用DefaultAddressedEnvelope.recipient()
来确定收到消息的来源,因为此方法将返回null
。
public java.net.InetSocketAddress localAddress()
Channel
SocketAddress
应该被转换为更具体的类型,如InetSocketAddress
以检索详细信息。
localAddress
接口
Channel
localAddress
在界面
DatagramChannel
localAddress
在班
AbstractChannel
null
如果此通道未绑定。
public ChannelMetadata metadata()
Channel
ChannelMetadata
的的Channel
其描述的性质Channel
。
public boolean isConnected()
DatagramChannel
DatagramChannel
已连接到远程对端,则返回true
。
isConnected
在界面
DatagramChannel
public ChannelFuture joinGroup(java.net.InetAddress multicastAddress)
DatagramChannel
ChannelFuture
。
joinGroup
,界面
DatagramChannel
public ChannelFuture joinGroup(java.net.InetAddress multicastAddress, ChannelPromise promise)
DatagramChannel
ChannelFuture
。
给定的ChannelFuture
将被通知并且返回。
joinGroup
,界面
DatagramChannel
public ChannelFuture joinGroup(java.net.InetSocketAddress multicastAddress, java.net.NetworkInterface networkInterface)
DatagramChannel
ChannelFuture
。
joinGroup
在界面
DatagramChannel
public ChannelFuture joinGroup(java.net.InetSocketAddress multicastAddress, java.net.NetworkInterface networkInterface, ChannelPromise promise)
DatagramChannel
ChannelFuture
。
给定的ChannelFuture
将被通知并返回。
joinGroup
接口
DatagramChannel
public ChannelFuture joinGroup(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress source)
DatagramChannel
复制的描述
ChannelFuture
。
joinGroup
在界面
DatagramChannel
public ChannelFuture joinGroup(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress source, ChannelPromise promise)
DatagramChannel
ChannelFuture
。
给定的ChannelFuture
将被通知并且返回。
joinGroup
在界面
DatagramChannel
public ChannelFuture leaveGroup(java.net.InetAddress multicastAddress)
DatagramChannel
ChannelFuture
。
leaveGroup
在界面
DatagramChannel
public ChannelFuture leaveGroup(java.net.InetAddress multicastAddress, ChannelPromise promise)
DatagramChannel
ChannelFuture
。
给定的ChannelFuture
将被通知并且返回。
leaveGroup
在界面
DatagramChannel
public ChannelFuture leaveGroup(java.net.InetSocketAddress multicastAddress, java.net.NetworkInterface networkInterface)
DatagramChannel
ChannelFuture
。
leaveGroup
接口
DatagramChannel
public ChannelFuture leaveGroup(java.net.InetSocketAddress multicastAddress, java.net.NetworkInterface networkInterface, ChannelPromise promise)
DatagramChannel
ChannelFuture
。
给定的ChannelFuture
将被通知并且返回。
leaveGroup
接口
DatagramChannel
public ChannelFuture leaveGroup(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress source)
DatagramChannel
ChannelFuture
。
leaveGroup
在界面
DatagramChannel
public ChannelFuture leaveGroup(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress source, ChannelPromise promise)
DatagramChannel
ChannelFuture
。
给定的ChannelFuture
将被通知并且返回。
leaveGroup
接口
DatagramChannel
public ChannelFuture block(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress sourceToBlock)
DatagramChannel
ChannelFuture
。
给定的ChannelFuture
将被通知并且返回。
block
在界面
DatagramChannel
public ChannelFuture block(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress sourceToBlock, ChannelPromise promise)
DatagramChannel
ChannelFuture
。
给定的ChannelFuture
将被通知并且返回。
block
,界面
DatagramChannel
public ChannelFuture block(java.net.InetAddress multicastAddress, java.net.InetAddress sourceToBlock)
DatagramChannel
ChannelFuture
。
给定的ChannelFuture
将被通知并且返回。
block
在界面
DatagramChannel
public ChannelFuture block(java.net.InetAddress multicastAddress, java.net.InetAddress sourceToBlock, ChannelPromise promise)
DatagramChannel
ChannelFuture
。
给定的ChannelFuture
将被通知并且返回。
block
在界面
DatagramChannel
protected io.netty.channel.epoll.AbstractEpollChannel.AbstractEpollUnsafe newUnsafe()
AbstractChannel
AbstractChannel.AbstractUnsafe
实例,该实例将用于Channel
的生命周期
protected void doBind(java.net.SocketAddress localAddress) throws java.lang.Exception
AbstractChannel
Channel
绑定到SocketAddress
java.lang.Exception
protected void doWrite(ChannelOutboundBuffer in) throws java.lang.Exception
AbstractChannel
doWrite
class
AbstractChannel
java.lang.Exception
protected java.lang.Object filterOutboundMessage(java.lang.Object msg)
AbstractChannel
AbstractChannel
的ChannelOutboundBuffer
中时调用 ,以便Channel
实现将消息转换为另一个消息。
(例如堆缓冲区 - >直接缓冲区)
public EpollDatagramChannelConfig config()
Channel
config
在界面
Channel
config
在界面
DatagramChannel
protected void doDisconnect() throws java.lang.Exception
AbstractChannel
Channel
从其远程对等端断开
java.lang.Exception
protected boolean doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress) throws java.lang.Exception
java.lang.Exception
protected void doClose() throws java.lang.Exception
AbstractChannel
Channel
java.lang.Exception
public final FileDescriptor fd()
UnixChannel
Channel
使用的FileDescriptor
。
fd
接口
UnixChannel
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 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.