Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HELP - Socket and Hostname?

 
lydia westland
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I used the InetAddress.getHostName() to get a computer's name. and the InetAddress.getIP(). The InetAddress is generated when the socket connection is established. But a werid thing is, sometimes this works well. sometimes the hostname is the IP( not the computer name). and sometimes the hostname can become some words got from the Hosts file. How can I do to make them consistent?
thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic