Module java.base

Class MembershipKey

java.lang.Object
java.nio.channels.MembershipKey

public abstract class MembershipKey extends Object
A token representing the membership of an Internet Protocol (IP) multicast group.

A membership key may represent a membership to receive all datagrams sent to the group, or it may be source-specific, meaning that it represents a membership that receives only datagrams from a specific source address. Whether or not a membership key is source-specific may be determined by invoking its sourceAddress method.

A membership key is valid upon creation and remains valid until the membership is dropped by invoking the drop method, or the channel is closed. The validity of the membership key may be tested by invoking its isValid method.

Where a membership key is not source-specific and the underlying operation system supports source filtering, then the block and unblock methods can be used to block or unblock multicast datagrams from particular source addresses.

Since:
1.7
See Also: