getting ip of remote system using java programs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rahulbsbs
    New Member
    • Feb 2007
    • 2

    #1

    getting ip of remote system using java programs

    Sir how can i get the ip address of the remote system by writting a java code,ie i want to get ip address of the remote system that is connected to my server computer ,the ip address must be obtained by writting a java program.Is there any class for that.Please give me an example for getting this.
  • horace1
    Recognized Expert Top Contributor
    • Nov 2006
    • 1510

    #2
    Originally posted by rahulbsbs
    Sir how can i get the ip address of the remote system by writting a java code,ie i want to get ip address of the remote system that is connected to my server computer ,the ip address must be obtained by writting a java program.Is there any class for that.Please give me an example for getting this.
    when a client connects to your server you will get a Socket and can use method getInetAddress( ) to find its IP address
    http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html

    Comment

    • iyengarshweta
      New Member
      • Apr 2007
      • 1

      #3
      Originally posted by rahulbsbs
      Sir how can i get the ip address of the remote system by writting a java code,ie i want to get ip address of the remote system that is connected to my server computer ,the ip address must be obtained by writting a java program.Is there any class for that.Please give me an example for getting this.
      i want some information as to how to find d IP address of a remote system and also the JAVA code for it....

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by iyengarshweta
        i want some information as to how to find d IP address of a remote system and also the JAVA code for it....
        We don't give out codes until you write some yourself first. Try the advice that you got and post if you get stuck at a more specific point.

        Comment

        • Aryavardan
          New Member
          • Mar 2008
          • 1

          #5
          Originally posted by rahulbsbs
          Sir how can i get the ip address of the remote system by writting a java code,ie i want to get ip address of the remote system that is connected to my server computer ,the ip address must be obtained by writting a java program.Is there any class for that.Please give me an example for getting this.
          I had the same question if u got information regarding this please give me an example

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Originally posted by Aryavardan
            I had the same question if u got information regarding this please give me an example
            Did you actually *read* the replies in this thread, especially the first one? Or did
            you just read the title and started typing?

            kind reagards,

            Jos

            Comment

            • gaya3
              New Member
              • Aug 2007
              • 184

              #7
              Originally posted by Aryavardan
              I had the same question if u got information regarding this please give me an example

              Hi,
              please refer to http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.htm l

              -Thanks & Regards,
              Hamsa

              Comment

              Working...