Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: how to get ip address of systems in multicasting environment..??

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Location
    India
    Posts
    1
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to get ip address of systems in multicasting environment..??

    hello community members...

    i want to know how to get the ip addresses of all systems joined into a multicasting group?
    plz tell if there is any facility in java to get the ip address of all machines connected to a LAN; or multicasting environment with the help of java program.


  2. #2
    Junior Member
    Join Date
    Dec 2012
    Location
    Iran
    Posts
    5
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: how to get ip address of systems in multicasting environment..??

    not sure but try this one :
    import java.net.*;
    import java.util.*;
    import java.io.*;
    import java.nio.*;
     
    public class IPAddress {
     public void  getInterfaces (){
          try {
             Enumeration e = NetworkInterface.getNetworkInterfaces();
     
             while(e.hasMoreElements()) {
                NetworkInterface ni = (NetworkInterface) e.nextElement();
                System.out.println("Net interface: "+ni.getName());
     
                Enumeration e2 = ni.getInetAddresses();
     
                while (e2.hasMoreElements()){
                   InetAddress ip = (InetAddress) e2.nextElement();
                   System.out.println("IP address: "+ ip.toString());
                }
             }
          }
          catch (Exception e) {
             e.printStackTrace();
          }
       }
     
       public static void main(String[] args) {
        IPAddress ip = new IPAddress();
        ip.getInterfaces();
       }
    }

Similar Threads

  1. setting up the JAVA EE environment
    By shreerangpande in forum Java Servlet
    Replies: 4
    Last Post: May 14th, 2014, 04:16 PM
  2. Solving linear equation systems including sparse matrices
    By GregXel in forum Java Theory & Questions
    Replies: 1
    Last Post: November 24th, 2012, 12:05 PM
  3. Program won't work on all operation systems
    By 123099 in forum AWT / Java Swing
    Replies: 8
    Last Post: July 18th, 2011, 05:11 PM
  4. Run 2 systems command in applet, how?
    By bulgin in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 8th, 2010, 03:11 PM
  5. Code wise working of Computer Algebra Systems
    By helloworld922 in forum Java Theory & Questions
    Replies: 1
    Last Post: July 7th, 2009, 07:45 AM