Results 1 to 12 of 12
Like Tree1Likes
  • 1 Post By Tolls

Thread: Getting IP address

  1. #1
    GaneshB is offline Member
    Join Date
    Jan 2012
    Posts
    5
    Rep Power
    0

    Default Getting IP address

    How to get IP address of a remote computer which is not on LAN using socket programming.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default Re: Getting IP address

    If your computer not in a LAN where you already connected, how can you see that?

  3. #3
    GaneshB is offline Member
    Join Date
    Jan 2012
    Posts
    5
    Rep Power
    0

    Default Re: Getting IP address

    I would like to give 1 example that if i m sitting in one building connected to office LAN and my friend is working in another company.So how I can get his IP address?

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default Re: Getting IP address

    So indirectly it is connected to your LAN, isn't it?

    Once a client/host connected to your server you will get a socket to communicate between them. If you have red about the Sockets in API you could find a method getInetAddress(), where you can get the IP.

  5. #5
    GaneshB is offline Member
    Join Date
    Jan 2012
    Posts
    5
    Rep Power
    0

    Default Re: Getting IP address

    Sir,
    My actual problem is that i am trying to develop one application that can use for aggregate the bandwidth.
    For instance,In college one LAB using Airtel internet with speed 2Mbps and another LAB using Reliance 3Mbps internet.then if one lab is close where we are using Airtel then how another reliance LAB and make use of Airtel Lab Bandwidth.

  6. #6
    GaneshB is offline Member
    Join Date
    Jan 2012
    Posts
    5
    Rep Power
    0

    Default Re: Getting IP address

    how we can recognize that how many different ways a computer is connected to internet using java?

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default Re: Getting IP address

    Still you have a machine where acting like a server. It always connect to all the others PCs in your location, that's all. Is it clear?

  8. #8
    GaneshB is offline Member
    Join Date
    Jan 2012
    Posts
    5
    Rep Power
    0

    Default Re: Getting IP address

    Please tell me how we can find any computer in LAN is accessing internet or not using java?

  9. #9
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default Re: Getting IP address

    Java really isn't the tool for this.
    It has a hard enough time accessing things on the computer it's running on, let alone another computer somewhere on your LAN.
    Eranga likes this.

  10. #10
    arielb is offline Member
    Join Date
    Jan 2012
    Location
    Panamá
    Posts
    41
    Rep Power
    0

    Default Re: Getting IP address

    JNI are saying in this case?

  11. #11
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default Re: Getting IP address

    Quote Originally Posted by GaneshB View Post
    Please tell me how we can find any computer in LAN is accessing internet or not using java?

    So that what you want to know is a computer in a LAN has internet access or not? That was not your original question seems. And also Java is not the right technology to use, as Tolls explain.

  12. #12
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. set IP address
    By yolimau in forum Networking
    Replies: 10
    Last Post: 05-30-2010, 02:37 AM
  2. Ip address finding
    By anilkumar_vist in forum New To Java
    Replies: 6
    Last Post: 04-10-2010, 03:06 AM
  3. JSP – getting IP address
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-29-2008, 09:05 AM
  4. MAC address capturing
    By viswa.tk in forum Java Applets
    Replies: 0
    Last Post: 12-13-2007, 08:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •