This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Unknown Host Exception thrown on machines with Static IP addresses  RSS feed

Sean McGurk
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all;
I have written a java program that sends SMS (text message) alers to a mobile phone. Now, the program works fine when run on its own (i.e. when the function sends out the message is called from a main method).
I have modified this program somewhat so that it is able to be called from an ASP page as follows:
<%<br /> set smsObj = GetObject("java:SendSMS_Example")<br /> resultStr = smsObj.sendSMS(message, number)<br /> %>
By removing the main method and placing the SendSMS_Example.class file in the C:\Windows\Java\Trustlib directory.
sendSMS is the name of the function that performs the processing on the message. It does this by opening up a socket connection to port 80 on the host machine, sending the data across this connection and reading back the response.
Now, this program works fine when it is run on a machine that has a static IP address, but not on a machine that has a dynamic IP address i.e. a machine whose IP address is allocated either by the proxy server (in the case of a networked PC) or by an ISP (in the case of a stand-alone computer).
Has anyone any ideas as to how I can possibly remedy/ work around this problem?
Any suggestions would be greatly appreciated.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!