• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

localhost or 127.0.0.1-> which is nore non-volatile

 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i am binding or looking up , which will be
the better option to use, localhost or 127.0.0.1.
the only differance i can think of is that,

localhost is ip + domain

i feel that localhost should be used because of this reason. am i on thr right track. please guide.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

when i am binding or looking up , which will be
the better option to use, localhost or 127.0.0.1.

The better option is not to use dns at all when you bind. For example:
registry.rebind("FlyHighService", remoteDataFactory);
Eugene.
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh that is a good option . but during lookup which would be preferred. i guess localhost??
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"localhost" is completely equivalent to "127.0.0.1". As the former is more descriptive and more easily understood by the proverbial junior programmer, I'd use "localhost" throughout.
BTW, "localhost" is not IP + domain. It directly translates to the IP 127.0.0.1.
- Peter
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Peter den Haan:

BTW, "localhost" is not IP + domain. It directly translates to the IP 127.0.0.1.
- Peter

i have tried pinging to both localhost and 127.0.0.1. localhost seems to use the domain appended with it. anyhow, i will use localhost as 127.0.0.1 is like the "magic number"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic