• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Networking

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to determine the ip-address of my computer (stand alone pc)
from another pc. Both are connected to the internet
I tried using InetAddress.getByName(my computer name)
it works on my pc but not in other pc's
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

what do you mean by stand alone pc
and then you say connected to internet

- satya
 
vinod ac
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

c satya when u get connected to the net ur ISP server will assign u an ip-address right ??
imagine u r connected 2 the internet. Certainly u will have some ip-address assigned by ur ISP. I want 2 determine that address assigned by the server using my java program from my computer.
did u get me now ???
any way thanxxx 4 responding......
- Vinod
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When the stand alone PC gets connected to the network, the PC is assigned a dynamic IP address ( if the PC is configured so). All you can do is, use java.net.InetAddress.getByName() call to get an InetAddress object and call the getAddress() method on that object. That will give you the eact IP address in byte[].
Hope this helps your problem.
-mo ibrahim
 
vinod ac
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ibrahim ,
Saw ur reply. Thanks a lot !
But i have a doubt, u need 2 pass an arguement to the InetAddress.getByName() method (String arguement)
what will u pass in the arguement
hostname ??? computer name ?? what else ???
 
Climb the rope! CLIMB THE ROPE! You too tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic