MembershipKey (Java Platform SE 8 ) (original) (raw)

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:
MulticastChannel

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.