Top Description Inners Methods
org.xnio.channels

public Interface MulticastMessageChannel

extends BoundMultipointMessageChannel
Imports
java.net.InetAddress, .NetworkInterface, java.io.IOException, .Closeable, org.xnio.ChannelListener

A multicast-capable point-to-multipoint channel. UDP channels are multipoint datagram channels which support multicast registration.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
MulticastMessageChannel.Key

A registration key for a multicast group.

Method Summary

Modifier and TypeMethod and Description
public ChannelListener.Setter<? extends MulticastMessageChannel>
getCloseSetter()

Redeclares org.xnio.channels.BoundMultipointMessageChannel.getCloseSetter.

Get the setter which can be used to change the close listener for this channel.

public ChannelListener.Setter<? extends MulticastMessageChannel>
getReadSetter()

Redeclares org.xnio.channels.BoundMultipointMessageChannel.getReadSetter.

Get the setter which can be used to change the read listener for this channel.

public ChannelListener.Setter<? extends MulticastMessageChannel>
getWriteSetter()

Redeclares org.xnio.channels.BoundMultipointMessageChannel.getWriteSetter.

Get the setter which can be used to change the write listener for this channel.

public MulticastMessageChannel.Key

Returns:

a new key
join
(InetAddress
the multicast address to join
group
,
NetworkInterface
the network interface to join on
iface
)

Join a multicast group to begin receiving all datagrams sent to the group.

public MulticastMessageChannel.Key

Returns:

a new key
join
(InetAddress
the multicast address to join
group
,
NetworkInterface
the network interface to join on
iface
,
InetAddress
the source address to listen for
source
)

Join a multicast group to begin receiving all datagrams sent to the group from a given source address.

Method Detail

getCloseSetterback to summary
public ChannelListener.Setter<? extends MulticastMessageChannel> getCloseSetter()

Redeclares org.xnio.channels.BoundMultipointMessageChannel.getCloseSetter.

Doc from org.xnio.channels.BoundMultipointMessageChannel.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.

Returns:ChannelListener.Setter<? extends MulticastMessageChannel>

Doc from org.xnio.channels.CloseableChannel.getCloseSetter.

the setter

getReadSetterback to summary
public ChannelListener.Setter<? extends MulticastMessageChannel> getReadSetter()

Redeclares org.xnio.channels.BoundMultipointMessageChannel.getReadSetter.

Doc from org.xnio.channels.BoundMultipointMessageChannel.getReadSetter.

Get the setter which can be used to change the read listener for this channel.

Returns:ChannelListener.Setter<? extends MulticastMessageChannel>

Doc from org.xnio.channels.SuspendableReadChannel.getReadSetter.

the setter

getWriteSetterback to summary
public ChannelListener.Setter<? extends MulticastMessageChannel> getWriteSetter()

Redeclares org.xnio.channels.BoundMultipointMessageChannel.getWriteSetter.

Doc from org.xnio.channels.BoundMultipointMessageChannel.getWriteSetter.

Get the setter which can be used to change the write listener for this channel.

Returns:ChannelListener.Setter<? extends MulticastMessageChannel>

Doc from org.xnio.channels.SuspendableWriteChannel.getWriteSetter.

the setter

joinback to summary
public MulticastMessageChannel.Key join(InetAddress group, NetworkInterface iface) throws 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:InetAddress

the multicast address to join

iface:NetworkInterface

the network interface to join on

Returns:MulticastMessageChannel.Key

a new key

Exceptions
IOException:
if an I/O error occurs
IllegalStateException:
if the channel is already a member of the group on this interface
IllegalArgumentException:
if the group parameters is not a multicast address, or is an unsupported address type
SecurityException:
if a security manager is set, and its SecurityManager#checkMulticast(InetAddress) method denies access to the group
joinback to summary
public 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:InetAddress

the multicast address to join

iface:NetworkInterface

the network interface to join on

source:InetAddress

the source address to listen for

Returns:MulticastMessageChannel.Key

a new key

Exceptions
IOException:
if an I/O error occurs
IllegalStateException:
if the channel is already a member of the group on this interface
IllegalArgumentException:
if the group parameters is not a multicast address, or is an unsupported address type
SecurityException:
if a security manager is set, and its SecurityManager#checkMulticast(InetAddress) method denies access to the group
UnsupportedOperationException:
if the implementation does not support source filtering
org.xnio.channels back to summary

public Interface MulticastMessageChannel.Key

extends Closeable

A registration key for a multicast group.

Method Summary

Modifier and TypeMethod and Description
public MulticastMessageChannel.Key

Returns:

this key
block
(InetAddress
the source address to block
source
)

Block multicast packets from the given source address.

public MulticastMessageChannel

Returns:

the channel
getChannel
()

Return the channel associated with this key.

public InetAddress

Returns:

the multicast group
getGroup
()

Return the multicast group for which this key was created.

public NetworkInterface

Returns:

the network interface
getNetworkInterface
()

Return the network interface for which this key was created.

public InetAddress

Returns:

the source address
getSourceAddress
()

Return the source address if this membership key is source specific, or null if this membership is not source specific.

public boolean

Returns:

true if the membership is still active
isOpen
()

Determine if this membership is active.

public MulticastMessageChannel.Key

Returns:

this key
unblock
(InetAddress
the source address to unblock
source
)

Unblock multicast packets from the given source address that was previously blocked using the block(InetAddress) method.

Inherited from java.io.Closeable:
close

Method Detail

blockback to summary
public MulticastMessageChannel.Key block(InetAddress source) throws IOException, UnsupportedOperationException, IllegalStateException, IllegalArgumentException

Block multicast packets from the given source address. If this membership key is not source-specific, and the implementation supports source filtering, then this method blocks multicast packets from the given source addresses. After a source address is blocked it may still be possible to receive datagrams from that source. This can arise when datagrams are waiting to be received in the socket's receive buffer.

Parameters
source:InetAddress

the source address to block

Returns:MulticastMessageChannel.Key

this key

Exceptions
IOException:
if an I/O error occurs
UnsupportedOperationException:
if the implementation does not support source filtering
IllegalStateException:
if this key is source-specific or is no longer valid
IllegalArgumentException:
if the source parameter is not a unicast address or is not the same address type as the multicast group
getChannelback to summary
public MulticastMessageChannel getChannel()

Return the channel associated with this key. This method will return the channel even after the membership is dropped.

Returns:MulticastMessageChannel

the channel

getGroupback to summary
public InetAddress getGroup()

Return the multicast group for which this key was created. This method will continue to return the group even after the membership is dropped.

Returns:InetAddress

the multicast group

getNetworkInterfaceback to summary
public NetworkInterface getNetworkInterface()

Return the network interface for which this key was created. This method will continue to return the network interface even after the membership is dropped or the channel is closed.

Returns:NetworkInterface

the network interface

getSourceAddressback to summary
public InetAddress getSourceAddress()

Return the source address if this membership key is source specific, or null if this membership is not source specific.

Returns:InetAddress

the source address

isOpenback to summary
public boolean isOpen()

Determine if this membership is active.

Returns:boolean

true if the membership is still active

unblockback to summary
public MulticastMessageChannel.Key unblock(InetAddress source) throws IOException, IllegalStateException, UnsupportedOperationException

Unblock multicast packets from the given source address that was previously blocked using the block(InetAddress) method.

Parameters
source:InetAddress

the source address to unblock

Returns:MulticastMessageChannel.Key

this key

Exceptions
IOException:
if an I/O error occurs
IllegalStateException:
if the given source address is not currently blocked or the key is no longer valid
UnsupportedOperationException:
if the implementation does not support source filtering