public class NioDatagramChannel extends AbstractNioChannel<java.nio.channels.DatagramChannel> implements DatagramChannel
DatagramChannel.AbstractNioChannel.WriteRequestQueue| Modifier and Type | Field and Description |
|---|---|
private NioDatagramChannelConfig |
config
|
private java.util.Map<java.net.InetAddress,java.util.List<java.nio.channels.MembershipKey>> |
memberships |
channel, currentWriteBuffer, currentWriteEvent, highWaterMarkCounter, inWriteNowLoop, remoteAddress, worker, writeBufferQueue, writeBufferSize, writeLock, writeSuspended, writeTask, writeTaskInTaskQueueOP_NONE, OP_READ, OP_READ_WRITE, OP_WRITE| Constructor and Description |
|---|
NioDatagramChannel(ChannelFactory factory,
ChannelPipeline pipeline,
ChannelSink sink,
NioDatagramWorker worker,
InternetProtocolFamily family) |
| Modifier and Type | Method and Description |
|---|---|
ChannelFuture |
block(java.net.InetAddress multicastAddress,
java.net.InetAddress sourceToBlock)
Block the given sourceToBlock address for the given multicastAddress
|
ChannelFuture |
block(java.net.InetAddress multicastAddress,
java.net.NetworkInterface networkInterface,
java.net.InetAddress sourceToBlock)
Block the given sourceToBlock address for the given multicastAddress on the given networkInterface
|
NioDatagramChannelConfig |
getConfig()
Returns the configuration of this channel.
|
(package private) java.nio.channels.DatagramChannel |
getDatagramChannel() |
(package private) java.net.InetSocketAddress |
getLocalSocketAddress() |
(package private) java.net.InetSocketAddress |
getRemoteSocketAddress() |
NioDatagramWorker |
getWorker()
Return the
AbstractNioWorker that handle the IO of the
AbstractNioChannel |
boolean |
isBound()
Returns
true if and only if this channel is bound to a
local address. |
boolean |
isConnected()
Returns
true if and only if this channel is connected to a
remote address. |
ChannelFuture |
joinGroup(java.net.InetAddress multicastAddress)
Joins a multicast group.
|
ChannelFuture |
joinGroup(java.net.InetAddress multicastAddress,
java.net.NetworkInterface networkInterface,
java.net.InetAddress source)
Joins the specified multicast group at the specified interface using the specified source.
|
ChannelFuture |
joinGroup(java.net.InetSocketAddress multicastAddress,
java.net.NetworkInterface networkInterface)
Joins the specified multicast group at the specified interface.
|
ChannelFuture |
leaveGroup(java.net.InetAddress multicastAddress)
Leaves a multicast group.
|
ChannelFuture |
leaveGroup(java.net.InetAddress multicastAddress,
java.net.NetworkInterface networkInterface,
java.net.InetAddress source)
Leave the specified multicast group at the specified interface using the specified source.
|
ChannelFuture |
leaveGroup(java.net.InetSocketAddress multicastAddress,
java.net.NetworkInterface networkInterface)
Leaves a multicast group on a specified local interface.
|
private static java.nio.channels.DatagramChannel |
openNonBlockingChannel(InternetProtocolFamily family) |
protected boolean |
setClosed()
Marks this channel as closed.
|
ChannelFuture |
write(java.lang.Object message,
java.net.SocketAddress remoteAddress)
Sends a message to this channel asynchronously.
|
getInternalInterestOps, getLocalAddress, getRemoteAddress, setInternalInterestOpsbind, close, compareTo, connect, disconnect, equals, getAttachment, getCloseFuture, getFactory, getId, getInterestOps, getParent, getPipeline, getSucceededFuture, getUnsupportedOperationFuture, getUserDefinedWritability, hashCode, isOpen, isReadable, isWritable, setAttachment, setInterestOps, setReadable, setUnwritable, setUserDefinedWritability, setWritable, toString, unbind, writeclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetLocalAddress, getRemoteAddressbind, close, connect, disconnect, getAttachment, getCloseFuture, getFactory, getId, getInterestOps, getParent, getPipeline, getUserDefinedWritability, isOpen, isReadable, isWritable, setAttachment, setInterestOps, setReadable, setUserDefinedWritability, unbind, writeprivate final NioDatagramChannelConfig config
private java.util.Map<java.net.InetAddress,java.util.List<java.nio.channels.MembershipKey>> memberships
NioDatagramChannel(ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, NioDatagramWorker worker, InternetProtocolFamily family)
private static java.nio.channels.DatagramChannel openNonBlockingChannel(InternetProtocolFamily family)
public NioDatagramWorker getWorker()
AbstractNioChannelAbstractNioWorker that handle the IO of the
AbstractNioChannelgetWorker in class AbstractNioChannel<java.nio.channels.DatagramChannel>public boolean isBound()
Channeltrue if and only if this channel is bound to a
local address.public boolean isConnected()
Channeltrue if and only if this channel is connected to a
remote address.isConnected in interface Channelprotected boolean setClosed()
AbstractChannelsetClosed in class AbstractNioChannel<java.nio.channels.DatagramChannel>true if and only if this channel was not marked as
closed yetpublic NioDatagramChannelConfig getConfig()
ChannelgetConfig in interface ChannelgetConfig in interface DatagramChannelgetConfig in class AbstractNioChannel<java.nio.channels.DatagramChannel>java.nio.channels.DatagramChannel getDatagramChannel()
public ChannelFuture joinGroup(java.net.InetAddress multicastAddress)
DatagramChanneljoinGroup in interface DatagramChannelpublic ChannelFuture joinGroup(java.net.InetSocketAddress multicastAddress, java.net.NetworkInterface networkInterface)
DatagramChanneljoinGroup in interface DatagramChannelpublic ChannelFuture joinGroup(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress source)
public ChannelFuture leaveGroup(java.net.InetAddress multicastAddress)
DatagramChannelleaveGroup in interface DatagramChannelpublic ChannelFuture leaveGroup(java.net.InetSocketAddress multicastAddress, java.net.NetworkInterface networkInterface)
DatagramChannelleaveGroup in interface DatagramChannelpublic ChannelFuture leaveGroup(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress source)
public ChannelFuture block(java.net.InetAddress multicastAddress, java.net.NetworkInterface networkInterface, java.net.InetAddress sourceToBlock)
public ChannelFuture block(java.net.InetAddress multicastAddress, java.net.InetAddress sourceToBlock)
java.net.InetSocketAddress getLocalSocketAddress()
throws java.lang.Exception
getLocalSocketAddress in class AbstractNioChannel<java.nio.channels.DatagramChannel>java.lang.Exceptionjava.net.InetSocketAddress getRemoteSocketAddress()
throws java.lang.Exception
getRemoteSocketAddress in class AbstractNioChannel<java.nio.channels.DatagramChannel>java.lang.Exceptionpublic ChannelFuture write(java.lang.Object message, java.net.SocketAddress remoteAddress)
ChannelDatagramChannel)
and is not connected yet, you must specify non-null address. Otherwise,
the write request will fail with NotYetConnectedException and
an 'exceptionCaught' event will be triggered.write in interface Channelwrite in class AbstractChannelmessage - the message to writeremoteAddress - where to send the specified message.
This method is identical to Channel.write(Object)
if null is specified here.ChannelFuture which will be notified when the
write request succeeds or fails