Code example for MulticastSocket

Methods: leaveGroup

0
			running = false;
            try { 
                if (groupAddr != null) {
                    ms.leaveGroup(groupAddr);
                } else if (groupSockAddr != null) {
                    ms.leaveGroup(groupSockAddr, groupNI);
                } 
            } catch (IOException e) {}
        } 
 
        public MulticastServer(InetAddress anAddress, int aPort)
                throws java.io.IOException { 
            rbuf = new byte[512];
            rbuf[0] = -1;
            rdp = new DatagramPacket(rbuf, rbuf.length);
            ms = new MulticastSocket(aPort);
            ms.setSoTimeout(2000);
            groupAddr = anAddress;
            ms.joinGroup(groupAddr);
        } 
Connect your IDE to all the code out there  Get Codota for Java