• Post Reply Bookmark Topic Watch Topic
  • New Topic

remote IP address  RSS feed

 
MoonChinn Goh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a standalone application which will create connection to another server(pls see codes below):
String stringURL = "http://www.company.com/servlets/TestServlet";
URL url = new URL(stringURL);
HttpURLConnection httpCon = (HttpURLConnection) url.openConnection();
httpCon.setRequestMethod("POST"); httpCon.setDoOutput(true);
My standalone application is sitting on a machine which is having a fixed IP address.
The funny thing is that the IP address that the connected servlet (TestServlet in this case) get is not the fixed IP address but another one.
Anyone can explain this to me?
Someone tell me that this is because the ISP remaps it somewhere in the gateway or network. If this is true, will the remaped IP address is fixed? or it will changed?
Thanks!
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you were behind an ADSL device with NAT activated, the server would see you as the public ip in the WAN interface on the device. While your computer would have a private ip.
 
MoonChinn Goh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for ur reply!
May I know that this IP address is static or not? I mean will it be changed?
As is it save to be used? As the IP address being grab is going to used for authentication (the server need to do IP matching).
Thanks!
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually the ISP charges more for static ip. Issue a tracert javaranch.com before and after swiching off/on your ASDL device to see if the ip has changed.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!