This week's book giveaway is in the General Computing forum.
We're giving away four copies of Raising Young Coders: A Parent’s Guide to Teaching Programming at Home and have Cassandra Chin on-line!
See this thread for details.
  • 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Unknown Host Exception thrown on machines with Static IP addresses

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
Regards,
Sean
 
reply
    Bookmark Topic Watch Topic
  • New Topic