Package java.net

Examples of java.net.NetworkInterface.supportsMulticast()


        try {
            final Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
            while (interfaces.hasMoreElements()) {
                final NetworkInterface next = interfaces.nextElement();

                if (next.supportsMulticast() && next.isUp()) {
                    list.add(next);
                }
            }
        } catch (SocketException e) {
            //Ignore
View Full Code Here


        // Check that Advertise could work.
        boolean defaultavert = false;
        try {
            for (Enumeration<NetworkInterface> ni = NetworkInterface.getNetworkInterfaces(); ni.hasMoreElements();) {
                NetworkInterface intf = ni.nextElement();
                if (intf.isUp() && intf.supportsMulticast())
                    defaultavert = true;
             }
        } catch (SocketException e) {
            // Ignore it.
        }
View Full Code Here

        try {
            final Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
            while (interfaces.hasMoreElements()) {
                final NetworkInterface next = interfaces.nextElement();

                if (next.supportsMulticast() && next.isUp()) {
                    list.add(next);
                }
            }
        } catch (SocketException e) {
            //Ignore
View Full Code Here

        try {
            final Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
            while (interfaces.hasMoreElements()) {
                final NetworkInterface next = interfaces.nextElement();

                if (next.supportsMulticast() && next.isUp()) {
                    list.add(next);
                }
            }
        } catch (SocketException e) {
            //Ignore
View Full Code Here

     */
    public void test_supportsMulticast() throws Exception {
        while (netifs.hasMoreElements()) {
            NetworkInterface netif = netifs.nextElement();
            String name = netif.getName();
            boolean multicast = netif.supportsMulticast();
            if (valid) {
                String cmd = multicast ? "ifconfig " + name + " -multicast"
                        : "ifconfig " + name + " multicast";
                Process proc = Runtime.getRuntime().exec(cmd);
                proc.waitFor();
View Full Code Here

                String cmd = multicast ? "ifconfig " + name + " -multicast"
                        : "ifconfig " + name + " multicast";
                Process proc = Runtime.getRuntime().exec(cmd);
                proc.waitFor();
                assertEquals(name + " multicast should be " + !multicast,
                        !multicast, netif.supportsMulticast());

                cmd = multicast ? "ifconfig " + name + " multicast"
                        : "ifconfig " + name + " -multicast";
                proc = Runtime.getRuntime().exec(cmd);
                proc.waitFor();
View Full Code Here

                cmd = multicast ? "ifconfig " + name + " multicast"
                        : "ifconfig " + name + " -multicast";
                proc = Runtime.getRuntime().exec(cmd);
                proc.waitFor();
                assertEquals(name + " multicast should be " + multicast,
                        multicast, netif.supportsMulticast());
            }
        }
    }

    /**
 
View Full Code Here

      outer: while (networkInterfaces.hasMoreElements())
      {
         NetworkInterface networkInterface = networkInterfaces.nextElement();
         if (networkInterface.isLoopback() || networkInterface.isVirtual() ||
             !networkInterface.isUp() ||
             !networkInterface.supportsMulticast())
         {
            continue;
         }

         Enumeration<InetAddress> en = networkInterface.getInetAddresses();
View Full Code Here

        // Check that Advertise could work.
        boolean defaultavert = false;
        try {
            for (Enumeration<NetworkInterface> ni = NetworkInterface.getNetworkInterfaces(); ni.hasMoreElements();) {
                NetworkInterface intf = ni.nextElement();
                if (intf.isUp() && intf.supportsMulticast())
                    defaultavert = true;
             }
        } catch (SocketException e) {
            // Ignore it.
        }
View Full Code Here

        try {
            final Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
            while (interfaces.hasMoreElements()) {
                final NetworkInterface next = interfaces.nextElement();

                if (next.supportsMulticast() && next.isUp()) {
                    list.add(next);
                }
            }
        } catch (SocketException e) {
            //Ignore
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.