I am creating a browser using The Java DJ Project library. I need to create a persistence socket connection from the browser(Client) to a predefined server. I want to put the Server IP address and Port at the browser side(Hard Coded) what will connect with that server. The socket connection could be created by Java or JavaScript. I want to do any option from the following 2 option.
If I create the socket connection using java then there must be a way to send data using that connection from JavaScript. I have an Applet that can do this thing. You can check the solution at this link >> http://stephengware.com/proj/javasocketbridge/ But I don't want to use applet any more. I want to call that Java socket connection from JavaScript or vice versa and send data without adding the applet into the page. I just want to Call javascript function to send date which will use that Java socket.
Or I want to create that connection using JavaScript, but it should be persistence. But if I do so then that connection should be used from Java to send the date.
So will you please tell me the answer of some of my question...
- Which method should I apply between 01 or 02 (Described above)? And why?
- How to do that? Can anyone please provide me some code to do that?
Would be very happy if anyone answer me.