MulticastSocket GetNetworkInterface() Example

returns the multicast NetworkInterface currently set


MulticastSocketclass GetNetworkInterface() method example. This example shows you how to use GetNetworkInterface() method.This method returns the multicast NetworkInterface currently set

Here is the code:-
/* 
 * @Program that  Get the multicast network interface set.
 * GetNetworkInterface.java 
 * Author:-RoseIndia Team
 * Date:-27-Jun-2008
 */

import java.net.*;

public class GetNetworkInterface {
 public static void main(String[] argsthrows Exception {
        SocketAddress sa = new InetSocketAddress(8080);
        MulticastSocket ms = new MulticastSocket(sa);
        //Get the multicast network interface set.
        System.out.println("network interface set is: "
                +ms.getNetworkInterface());
    }

}

Output of the program:-
 network interface set is: name:null index: -1 addresses:
0.0.0.0/0.0.0.0;

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US