This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Pipeline as Code and have Mohamed Labouardy on-line!
See this thread for details.
Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

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 ???
 
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic