Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Socket Applets(URGENT)

 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How Can I use Applet to open Sockets? (NOT APPLICATION)
Thanks in advance,
Angela
 
maateen ashraf
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Angela Jessi
Its not possible to get a socket through an applet on local machine with server machine
cuz of the security policy of JVM of Browser.
any how if u find some solution for that then plz write it.
thanx in advance

 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've explored this issue quite a bit, and, until browsers become more robust, I think the only solution is to have the have the applet make the initial connection to the server and then procede as normal. If you must have the server contact the applet, then you'll have to use the Sun Java PlugIn since it is somewhat more lenient when it comes to security and setting security properties (Java 2 fine-grained security, etc.). I suggest you look at this simple chat application. It uses sockets and creates no security issues because it's permissable for the Appet to create a socket connection back to the same server that the Applet loaded from.
http://homepages.unl.ac.uk/~wrightc/tyj/Comms.htm#ChatClient http://homepages.unl.ac.uk/~wrightc/tyj/Comms.htm#ChatServer
I hope this helps.
Sean
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic