Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code LNG204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.
java.nio.channels

Class 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:
    MulticastChannel
    • Constructor Detail

      • MembershipKey

        protected MembershipKey()
        Initializes a new instance of this class.
    • Method Detail

      • isValid

        public abstract boolean isValid()
        Tells whether or not this membership is valid.

        A multicast group membership is valid upon creation and remains valid until the membership is dropped by invoking the drop method, or the channel is closed.

        Returns:
        true if this membership key is valid, false otherwise
      • drop

        public abstract void drop()
        Drop membership.

        If the membership key represents a membership to receive all datagrams then the membership is dropped and the channel will no longer receive any datagrams sent to the group. If the membership key is source-specific then the channel will no longer receive datagrams sent to the group from that source address.

        After membership is dropped it may still be possible to receive datagrams sent to the group. This can arise when datagrams are waiting to be received in the socket's receive buffer. After membership is dropped then the channel may join the group again in which case a new membership key is returned.

        Upon return, this membership object will be invalid. If the multicast group membership is already invalid then invoking this method has no effect. Once a multicast group membership is invalid, it remains invalid forever.

      • block

        public abstract MembershipKey block(InetAddress source)
                                     throws IOException
        Block multicast datagrams from the given source address.

        If this membership key is not source-specific, and the underlying operating system supports source filtering, then this method blocks multicast datagrams from the given source address. If the given source address is already blocked then this method has no effect. After a source address is blocked it may still be possible to receive datagams from that source. This can arise when datagrams are waiting to be received in the socket's receive buffer.

        Parameters:
        source - The source address to block
        Returns:
        This membership key
        Throws:
        IllegalArgumentException - If the source parameter is not a unicast address or is not the same address type as the multicast group
        IllegalStateException - If this membership key is source-specific or is no longer valid
        UnsupportedOperationException - If the underlying operating system does not support source filtering
        IOException - If an I/O error occurs
      • unblock

        public abstract MembershipKey unblock(InetAddress source)
        Unblock multicast datagrams from the given source address that was previously blocked using the block method.
        Parameters:
        source - The source address to unblock
        Returns:
        This membership key
        Throws:
        IllegalStateException - If the given source address is not currently blocked or the membership key is no longer valid
      • channel

        public abstract MulticastChannel channel()
        Returns the channel for which this membership key was created. This method will continue to return the channel even after the membership becomes invalid.
        Returns:
        the channel
      • group

        public abstract InetAddress group()
        Returns the multicast group for which this membership key was created. This method will continue to return the group even after the membership becomes invalid.
        Returns:
        the multicast group
      • networkInterface

        public abstract NetworkInterface networkInterface()
        Returns the network interface for which this membership key was created. This method will continue to return the network interface even after the membership becomes invalid.
        Returns:
        the network interface
      • sourceAddress

        public abstract InetAddress sourceAddress()
        Returns the source address if this membership key is source-specific, or null if this membership is not source-specific.
        Returns:
        The source address if this membership key is source-specific, otherwise null

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-java/nio/channels/MembershipKey.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut