File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes applet socket programming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "applet socket programming" Watch "applet socket programming" New topic

applet socket programming

akalanka de silva

Joined: Sep 14, 2004
Posts: 18
hey i want to connect serverSocket and Socket in two machine by the applet any ideas if u have pls send me.most i like to source code.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

You can't open a ServerSocket in an applet unless the applet is digitally signed. Once that's taken care of and the policy files are configured, it's no different than opening a ServerSocket in any other Java program.

You can study Part III of the Java Plug-in Programing Guide to learn about signed applets, and here's a networking tutorial to learn about Java sockets in general.

[Jess in Action][AskingGoodQuestions]
Emmy Rauch

Joined: Jul 07, 2004
Posts: 12
Your question isn't clear, but if you have an application running a ServerSocket you can connect to it from an Applet using Socket IF the application is running on the same computer as the webserver that is hosting the applet. If you are looking to send data between two applet you will need to make some sort of server program to accept multiple connections, and have each user (running an Applet) open a Socket to this server.
I agree. Here's the link:
subject: applet socket programming
jQuery in Action, 3rd edition