-
- All Superinterfaces:
java.lang.AutoCloseable
,BoundChannel
,BoundMultipointMessageChannel
,java.nio.channels.Channel
,java.io.Closeable
,CloseableChannel
,Configurable
,java.nio.channels.InterruptibleChannel
,MultipointMessageChannel
,ReadableMultipointMessageChannel
,SuspendableChannel
,SuspendableReadChannel
,SuspendableWriteChannel
,WritableMultipointMessageChannel
public interface MulticastMessageChannel extends BoundMultipointMessageChannel
A multicast-capable point-to-multipoint channel. UDP channels are multipoint datagram channels which support multicast registration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
MulticastMessageChannel.Key
A registration key for a multicast group.
-
Field Summary
-
Fields inherited from interface org.xnio.channels.Configurable
EMPTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ChannelListener.Setter<? extends MulticastMessageChannel>
getCloseSetter()
Get the setter which can be used to change the close listener for this channel.ChannelListener.Setter<? extends MulticastMessageChannel>
getReadSetter()
Get the setter which can be used to change the read listener for this channel.ChannelListener.Setter<? extends MulticastMessageChannel>
getWriteSetter()
Get the setter which can be used to change the write listener for this channel.MulticastMessageChannel.Key
join(java.net.InetAddress group, java.net.NetworkInterface iface)
Join a multicast group to begin receiving all datagrams sent to the group.MulticastMessageChannel.Key
join(java.net.InetAddress group, java.net.NetworkInterface iface, java.net.InetAddress source)
Join a multicast group to begin receiving all datagrams sent to the group from a given source address.-
Methods inherited from interface org.xnio.channels.BoundChannel
getLocalAddress, getLocalAddress
-
Methods inherited from interface org.xnio.channels.CloseableChannel
getIoThread, getWorker
-
Methods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOption
-
Methods inherited from interface org.xnio.channels.ReadableMultipointMessageChannel
receiveFrom, receiveFrom, receiveFrom
-
Methods inherited from interface org.xnio.channels.SuspendableReadChannel
awaitReadable, awaitReadable, getReadThread, isReadResumed, resumeReads, shutdownReads, suspendReads, wakeupReads
-
Methods inherited from interface org.xnio.channels.SuspendableWriteChannel
awaitWritable, awaitWritable, close, flush, getWriteThread, isOpen, isWriteResumed, resumeWrites, shutdownWrites, suspendWrites, wakeupWrites
-
Methods inherited from interface org.xnio.channels.WritableMultipointMessageChannel
sendTo, sendTo, sendTo
-
-
-
-
Method Detail
-
join
MulticastMessageChannel.Key join(java.net.InetAddress group, java.net.NetworkInterface iface) throws java.io.IOException
Join a multicast group to begin receiving all datagrams sent to the group. A multicast channel may join several multicast groups, including the same group on more than one interface. An implementation may impose a limit on the number of groups that may be joined at the same time.- Parameters:
group
- the multicast address to joiniface
- the network interface to join on- Returns:
- a new key
- Throws:
java.io.IOException
- if an I/O error occursjava.lang.IllegalStateException
- if the channel is already a member of the group on this interfacejava.lang.IllegalArgumentException
- if thegroup
parameters is not a multicast address, or is an unsupported address typejava.lang.SecurityException
- if a security manager is set, and itsSecurityManager.checkMulticast(InetAddress)
method denies access to the group
-
join
MulticastMessageChannel.Key join(java.net.InetAddress group, java.net.NetworkInterface iface, java.net.InetAddress source) throws java.io.IOException
Join a multicast group to begin receiving all datagrams sent to the group from a given source address. A multicast channel may join several multicast groups, including the same group on more than one interface. An implementation may impose a limit on the number of groups that may be joined at the same time.- Parameters:
group
- the multicast address to joiniface
- the network interface to join onsource
- the source address to listen for- Returns:
- a new key
- Throws:
java.io.IOException
- if an I/O error occursjava.lang.IllegalStateException
- if the channel is already a member of the group on this interfacejava.lang.IllegalArgumentException
- if thegroup
parameters is not a multicast address, or is an unsupported address typejava.lang.SecurityException
- if a security manager is set, and itsSecurityManager.checkMulticast(InetAddress)
method denies access to the groupjava.lang.UnsupportedOperationException
- if the implementation does not support source filtering
-
getReadSetter
ChannelListener.Setter<? extends MulticastMessageChannel> getReadSetter()
Get the setter which can be used to change the read listener for this channel.- Specified by:
getReadSetter
in interfaceBoundMultipointMessageChannel
- Specified by:
getReadSetter
in interfaceMultipointMessageChannel
- Specified by:
getReadSetter
in interfaceReadableMultipointMessageChannel
- Specified by:
getReadSetter
in interfaceSuspendableChannel
- Specified by:
getReadSetter
in interfaceSuspendableReadChannel
- Returns:
- the setter
-
getCloseSetter
ChannelListener.Setter<? extends MulticastMessageChannel> getCloseSetter()
Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.- Specified by:
getCloseSetter
in interfaceBoundChannel
- Specified by:
getCloseSetter
in interfaceBoundMultipointMessageChannel
- Specified by:
getCloseSetter
in interfaceCloseableChannel
- Specified by:
getCloseSetter
in interfaceMultipointMessageChannel
- Specified by:
getCloseSetter
in interfaceReadableMultipointMessageChannel
- Specified by:
getCloseSetter
in interfaceSuspendableChannel
- Specified by:
getCloseSetter
in interfaceSuspendableReadChannel
- Specified by:
getCloseSetter
in interfaceSuspendableWriteChannel
- Specified by:
getCloseSetter
in interfaceWritableMultipointMessageChannel
- Returns:
- the setter
-
getWriteSetter
ChannelListener.Setter<? extends MulticastMessageChannel> getWriteSetter()
Get the setter which can be used to change the write listener for this channel.- Specified by:
getWriteSetter
in interfaceBoundMultipointMessageChannel
- Specified by:
getWriteSetter
in interfaceMultipointMessageChannel
- Specified by:
getWriteSetter
in interfaceSuspendableChannel
- Specified by:
getWriteSetter
in interfaceSuspendableWriteChannel
- Specified by:
getWriteSetter
in interfaceWritableMultipointMessageChannel
- Returns:
- the setter
-
-