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 interfaceA 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, getLocalAddressMethods inherited from interface org.xnio.channels.CloseableChannel
getIoThread, getWorkerMethods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOptionMethods inherited from interface org.xnio.channels.ReadableMultipointMessageChannel
receiveFrom, receiveFrom, receiveFromMethods inherited from interface org.xnio.channels.SuspendableReadChannel
awaitReadable, awaitReadable, getReadThread, isReadResumed, resumeReads, shutdownReads, suspendReads, wakeupReadsMethods inherited from interface org.xnio.channels.SuspendableWriteChannel
awaitWritable, awaitWritable, close, flush, getWriteThread, isOpen, isWriteResumed, resumeWrites, shutdownWrites, suspendWrites, wakeupWritesMethods 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 thegroupparameters 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 thegroupparameters 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:
getReadSetterin interfaceBoundMultipointMessageChannel- Specified by:
getReadSetterin interfaceMultipointMessageChannel- Specified by:
getReadSetterin interfaceReadableMultipointMessageChannel- Specified by:
getReadSetterin interfaceSuspendableChannel- Specified by:
getReadSetterin 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:
getCloseSetterin interfaceBoundChannel- Specified by:
getCloseSetterin interfaceBoundMultipointMessageChannel- Specified by:
getCloseSetterin interfaceCloseableChannel- Specified by:
getCloseSetterin interfaceMultipointMessageChannel- Specified by:
getCloseSetterin interfaceReadableMultipointMessageChannel- Specified by:
getCloseSetterin interfaceSuspendableChannel- Specified by:
getCloseSetterin interfaceSuspendableReadChannel- Specified by:
getCloseSetterin interfaceSuspendableWriteChannel- Specified by:
getCloseSetterin 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:
getWriteSetterin interfaceBoundMultipointMessageChannel- Specified by:
getWriteSetterin interfaceMultipointMessageChannel- Specified by:
getWriteSetterin interfaceSuspendableChannel- Specified by:
getWriteSetterin interfaceSuspendableWriteChannel- Specified by:
getWriteSetterin interfaceWritableMultipointMessageChannel- Returns:
- the setter
-