Package org.xnio.channels
Interface MulticastMessageChannel
- All Superinterfaces:
AutoCloseable
,BoundChannel
,BoundMultipointMessageChannel
,Channel
,Closeable
,CloseableChannel
,Configurable
,InterruptibleChannel
,MultipointMessageChannel
,ReadableMultipointMessageChannel
,SuspendableChannel
,SuspendableReadChannel
,SuspendableWriteChannel
,WritableMultipointMessageChannel
A multicast-capable point-to-multipoint channel. UDP channels are multipoint datagram channels which support multicast registration.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A registration key for a multicast group. -
Field Summary
Fields inherited from interface org.xnio.channels.Configurable
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptionChannelListener.Setter
<? extends MulticastMessageChannel> Get the setter which can be used to change the close listener for this channel.ChannelListener.Setter
<? extends MulticastMessageChannel> Get the setter which can be used to change the read listener for this channel.ChannelListener.Setter
<? extends MulticastMessageChannel> Get the setter which can be used to change the write listener for this channel.join
(InetAddress group, NetworkInterface iface) Join a multicast group to begin receiving all datagrams sent to the group.join
(InetAddress group, NetworkInterface iface, 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 Details
-
join
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:
IOException
- if an I/O error occursIllegalStateException
- if the channel is already a member of the group on this interfaceIllegalArgumentException
- if thegroup
parameters is not a multicast address, or is an unsupported address typeSecurityException
- if a security manager is set, and itsSecurityManager.checkMulticast(InetAddress)
method denies access to the group
-
join
MulticastMessageChannel.Key join(InetAddress group, NetworkInterface iface, InetAddress source) throws 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:
IOException
- if an I/O error occursIllegalStateException
- if the channel is already a member of the group on this interfaceIllegalArgumentException
- if thegroup
parameters is not a multicast address, or is an unsupported address typeSecurityException
- if a security manager is set, and itsSecurityManager.checkMulticast(InetAddress)
method denies access to the groupUnsupportedOperationException
- 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
-