Code example for MulticastSocket

Methods: getNetworkInterfacesetInterfacesetNetworkInterface

0
                assertEquals("getNetworkInterface did not return network interface set by second setNetworkInterface call", 
                             networkInterface2, mss.getNetworkInterface());
            } 
 
            groupPort = Support_PortManager.getNextPortForUDP();
            mss = new MulticastSocket(groupPort);
            if (IPV6networkInterface1 != null) {
                mss.setNetworkInterface(IPV6networkInterface1);
                assertEquals("getNetworkInterface did not return interface set by setNeworkInterface", 
                             IPV6networkInterface1,
                             mss.getNetworkInterface());
            } 
 
            // validate that we get the expected response when we set via 
            // setInterface 
            groupPort = Support_PortManager.getNextPortForUDP();
            mss = new MulticastSocket(groupPort);
            Enumeration addresses = networkInterface1.getInetAddresses();
            if (addresses.hasMoreElements()) {
                firstAddress = (InetAddress) addresses.nextElement();
Stop searching for code, let great code find you!  Add Codota to your java IDE