Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applets and socket problem 1

Status
Not open for further replies.

Raywall

Programmer
Oct 1, 2003
51
RO
I'm working on a chat program and the clients must be done using applet.The problem is that I have one error when the client connects:
something with socket perimision.If I run the server and the clients on the same machine everithing works just fine so I guess there's some problem with security when applets are used.Is there something special that I must do or the program should work without declaring Socket permisions? I'm somehow new in java so,if there are some basics using sockets in applets my mistake :)
Also please tell me how can I display Images in a frame(awt).
Thanks...

 
Are the applet and servlet's codebase running on the same server ?
 
I'm sorry but I don't know what a servlet is.
I'll try to answer somehow. The server is running on a machine and has no interface to display, and the clients from different machines must connect to the server. The chat is designed for LAN but every client must have applet as interface.I used ServerSocket and Socket.
Bassicaly, on the server I have:

ServerSocket server=new ServerSocket(1300);
Socket client=server.accept();

And on every client :
Socket client=new Socket(server_name,1300);

For the last line I get the socket permission error and I don't know why.
I hope you can help me with this.
Thank you...
 
Sorry, I read "socket" as "servlet". Applets are tied down tightly as to what they can and cannot do. This explainas it better than I could :


You will most likely need to create a signed applet/signed jar file. Google for how-to's, here are two :

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top