Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting permissions to open a socket

 
Erick Smith
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I would like to improve my applet so that it accesses a Server program via a client/server system.
I am thinking I should just write my own Server program and just open a socket to it on some port. I have two questions, however:
1) How do I set the proper permissions on my Host machine so the applet can connect to the Server program from elswhere on the Internet?
2) What would be the pro's and con's of using a Applet/Servet combo to do this? Or does Applet/Servlet not work like Client/Server?
Thanks,
Erick
PS - This board has been far more helpful to mee than any boards on the Sun site! Thanks much for everyone's previous help.
 
Tom P
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No permissions are required. All you need is a ServerSocket listening on some port. The only requirement is that the Applet must be connecting back to the server it came from. The browser's security mechanism will not allow the applet to connect to any other server unless it has a security certificate AND the user gives permission.
I personally prefer the applet/servlet combo. The only difficulty is in maintaining state on the server side but you can do that through the data you pass back to the server. Also, with the applet/servlet comination there is no browser security limitation on connecting to a different server than the applet came from.
[This message has been edited by Tom P (edited May 06, 2000).]
 
Pawel Veselov
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just add-on. Applet can open a connection only to the host this applet was downloaded from.
 
Tom P
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I mentioned that in my answer. If you need to go to another server you will need a certificate.
 
Pawel Veselov
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops, my fault :O
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic