• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

problems naming a host parameter

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to connect to a chat server application that I have on my local machine, but when I run the applet I get the following error:

applet error: java.net.ConnectException: Connection refused: connect

I changed the parameter name several times and get some different errors such as:

applet error: java.security.AccessControlException: access denied (java.net.SocketPermission [C:\......(path to server)] resolve)

I assume it has to do with the host parameter in my applet. I am wondering how to name the host. Any suggestions would be appreciated.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An applet is only allowed to make network connections to the host where it came from. So if the applet is hosted at www.xyz.com, and the chat server is at www.xxyyzz.com, the connection is not permitted. That's one of the consequences of applets living in a "sandbox" inside the browser. Have a look at the Applet FAQ for ways to get around those restrictions.
 
Everybody's invited. Except this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic