Code example for MulticastSocket

Methods: leaveGroup

0
     */ 
    public void leave(InetAddress groupAddress) throws MulticastException {
        MulticastSocket socket = sockets.get(groupAddress);
 
        try { 
            socket.leaveGroup(groupAddress);
 
            sockets.remove(groupAddress);
        } catch (IOException e) {
            throw new MulticastException(e);
        } 
    } 
 
    /** 
     * Send data to the joined multicast group. 
     *  
     * @param data 
     *            Data that you want to send 
     * @param remotePort 
     *            Remote-side port number 
     * @return Size of the data that I actually sent