org.jboss.xnio.nio
Class BioMulticastChannelImpl
java.lang.Object
org.jboss.xnio.nio.BioDatagramChannelImpl
org.jboss.xnio.nio.BioMulticastChannelImpl
- All Implemented Interfaces:
- java.io.Closeable, java.nio.channels.Channel, BoundChannel<java.net.SocketAddress>, Configurable, MultipointDatagramChannel<java.net.SocketAddress>, MultipointMessageChannel<java.net.SocketAddress>, MultipointReadableMessageChannel<java.net.SocketAddress>, MultipointWritableMessageChannel<java.net.SocketAddress>, SuspendableChannel, SuspendableReadChannel, SuspendableWriteChannel, UdpChannel
public class BioMulticastChannelImpl
- extends BioDatagramChannelImpl
- implements UdpChannel
Method Summary |
|
getOption(ChannelOption<T> option)
Get the value of a channel option. |
java.util.Set<ChannelOption<?>> |
getOptions()
Get the options that may be set on this channel. |
UdpChannel.Key |
join(java.net.InetAddress group,
java.net.NetworkInterface iface)
Join a multicast group to begin receiving all datagrams sent to the group. |
UdpChannel.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. |
|
setOption(ChannelOption<T> option,
T value)
Set an option for this channel. |
Methods inherited from class org.jboss.xnio.nio.BioDatagramChannelImpl |
awaitReadable, awaitReadable, awaitWritable, awaitWritable, close, getLocalAddress, isOpen, open, receive, resumeReads, resumeWrites, send, send, send, shutdownReads, shutdownWrites, suspendReads, suspendWrites |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.nio.channels.Channel |
close, isOpen |
join
public UdpChannel.Key join(java.net.InetAddress group,
java.net.NetworkInterface iface)
throws java.io.IOException
- Description copied from interface:
UdpChannel
- 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.
- Specified by:
join
in interface UdpChannel
- Overrides:
join
in class BioDatagramChannelImpl
- 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 occurs
join
public UdpChannel.Key join(java.net.InetAddress group,
java.net.NetworkInterface iface,
java.net.InetAddress source)
throws java.io.IOException
- Description copied from interface:
UdpChannel
- 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.
- Specified by:
join
in interface UdpChannel
- Overrides:
join
in class BioDatagramChannelImpl
- 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 occurs
getOption
public <T> T getOption(ChannelOption<T> option)
throws UnsupportedOptionException,
java.io.IOException
- Description copied from interface:
Configurable
- Get the value of a channel option.
- Specified by:
getOption
in interface Configurable
- Overrides:
getOption
in class BioDatagramChannelImpl
- Type Parameters:
T
- the type of the option value- Parameters:
option
- the option to get
- Returns:
- the value of the option
- Throws:
UnsupportedOptionException
- if the option is not supported by this channel
java.io.IOException
- if an I/O error occurred when reading the option
getOptions
public java.util.Set<ChannelOption<?>> getOptions()
- Description copied from interface:
Configurable
- Get the options that may be set on this channel.
- Specified by:
getOptions
in interface Configurable
- Overrides:
getOptions
in class BioDatagramChannelImpl
- Returns:
- an unmodifiable set of options
setOption
public <T> Configurable setOption(ChannelOption<T> option,
T value)
throws java.lang.IllegalArgumentException,
java.io.IOException
- Description copied from interface:
Configurable
- Set an option for this channel.
- Specified by:
setOption
in interface Configurable
- Overrides:
setOption
in class BioDatagramChannelImpl
- Type Parameters:
T
- the type of the option value- Parameters:
option
- the option to setvalue
- the value of the option to set
- Returns:
- this channel
- Throws:
UnsupportedOptionException
- if the option is not supported by this channel
java.lang.IllegalArgumentException
- if the value is not acceptable for this option
java.io.IOException
- if an I/O error occured when modifying the option