• 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

IP address keeps changing

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone. My IP address keeps changing every time I connect to the Internet. I need the ip address for RMI Connection.

Naming.lookup("rmi://127.0.0.1/Compute")

I need to put my IP address in the above but dont know how to go about it.

Thankx.
 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You want to access the machine from remote, over the internet? IN that case, check out services like DynDNS. Or do you want to connect from some other machine on your local network?
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wecome to the Ranch

So does mine. I think there is dynamic and static IP assignment.
I tried googling and this was the first hit. I don’t know how helpful it will be. It is full of annoying abbreviations which confirm we are right to have this FAQ.
 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if i am correct you can use the below code to fetch local IPaddress


 
Agr Raj
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys thank you for your Greetings.

Let me explain the problem more clearly
When i run the application on the same machine using the IP address as 127.0.0.1 it works well. But, when i run the client on a separate machine using the current IP address that is 120.138.114.167 I get some sxception saying Connection refused to host address 120.138.114.167. I tried running the same application after turning my firewall off but still got the same exception

Note: the IP address that i have is dynamic that means it keeps changing every time I restart my router. I manually update the client file whenever the IP changes.
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's how I understood the question. What are the answers to the 2 questions I asked?
 
Agr Raj
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:That's how I understood the question. What are the answers to the 2 questions I asked?



I want to connect from some other machine to my local network
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me emphasize what I'm asking:

You want to access the machine from remote, over the internet? ... Or do you want to connect from some other machine on your local network?

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

Tim Moores wrote:Let me emphasize what I'm asking:

You want to access the machine from remote, over the internet? ... Or do you want to connect from some other machine on your local network?



over the internet
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then DynDNS (or some service like it) is the answer.
 
Agr Raj
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the server class



The Client Class



The Remote Interface



Runs perfectly on the same machine.
Then,
I changed the IP address in the ClientClass to 111.119.254.32, turned the firewall off and tried accessing the server from a different machine over the Internet and got the following error
Connection refused to host: 111.119.254.32 and some more nested Exception

Please help me spot where I'm Going wrong.


 
Police line, do not cross. Well, this tiny ad can go through:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic