src/share/classes/java/net/MulticastSocket.java

Print this page
rev 10048 : 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
Reviewed-by:


  60  * ...
  61  * // OK, I'm done talking - leave the group...
  62  * s.leaveGroup(group);
  63  * </PRE>
  64  *
  65  * When one sends a message to a multicast group, <B>all</B> subscribing
  66  * recipients to that host and port receive the message (within the
  67  * time-to-live range of the packet, see below).  The socket needn't
  68  * be a member of the multicast group to send messages to it.
  69  * <P>
  70  * When a socket subscribes to a multicast group/port, it receives
  71  * datagrams sent by other hosts to the group/port, as do all other
  72  * members of the group and port.  A socket relinquishes membership
  73  * in a group by the leaveGroup(InetAddress addr) method.  <B>
  74  * Multiple MulticastSocket's</B> may subscribe to a multicast group
  75  * and port concurrently, and they will all receive group datagrams.
  76  * <P>
  77  * Currently applets are not allowed to use multicast sockets.
  78  *
  79  * @author Pavani Diwanji
  80  * @since  JDK1.1
  81  */
  82 public
  83 class MulticastSocket extends DatagramSocket {
  84 
  85     /**
  86      * Used on some platforms to record if an outgoing interface
  87      * has been set for this socket.
  88      */
  89     private boolean interfaceSet;
  90 
  91     /**
  92      * Create a multicast socket.
  93      *
  94      * <p>If there is a security manager,
  95      * its {@code checkListen} method is first called
  96      * with 0 as its argument to ensure the operation is allowed.
  97      * This could result in a SecurityException.
  98      * <p>
  99      * When the socket is created the
 100      * {@link DatagramSocket#setReuseAddress(boolean)} method is




  60  * ...
  61  * // OK, I'm done talking - leave the group...
  62  * s.leaveGroup(group);
  63  * </PRE>
  64  *
  65  * When one sends a message to a multicast group, <B>all</B> subscribing
  66  * recipients to that host and port receive the message (within the
  67  * time-to-live range of the packet, see below).  The socket needn't
  68  * be a member of the multicast group to send messages to it.
  69  * <P>
  70  * When a socket subscribes to a multicast group/port, it receives
  71  * datagrams sent by other hosts to the group/port, as do all other
  72  * members of the group and port.  A socket relinquishes membership
  73  * in a group by the leaveGroup(InetAddress addr) method.  <B>
  74  * Multiple MulticastSocket's</B> may subscribe to a multicast group
  75  * and port concurrently, and they will all receive group datagrams.
  76  * <P>
  77  * Currently applets are not allowed to use multicast sockets.
  78  *
  79  * @author Pavani Diwanji
  80  * @since  1.1
  81  */
  82 public
  83 class MulticastSocket extends DatagramSocket {
  84 
  85     /**
  86      * Used on some platforms to record if an outgoing interface
  87      * has been set for this socket.
  88      */
  89     private boolean interfaceSet;
  90 
  91     /**
  92      * Create a multicast socket.
  93      *
  94      * <p>If there is a security manager,
  95      * its {@code checkListen} method is first called
  96      * with 0 as its argument to ensure the operation is allowed.
  97      * This could result in a SecurityException.
  98      * <p>
  99      * When the socket is created the
 100      * {@link DatagramSocket#setReuseAddress(boolean)} method is