views:

288

answers:

2

I have an applet that I want to maintain a socket connection between multiple web pages. Currently, when a transition is made to a different page, the socket connection is closed. Is there anyway of maintaining that connection between web pages? Or, do you have to reconnect the socket after each web page transition?

+2  A: 

Unless you can put the applet in a separate frame or load the rest of the page via AJAX, the applet is being reloaded when the page is. So no, there really isn't a way.

Edward Amsden
+1  A: 

The socket is getting disconnected because the page reloading is causing the applet to run the destroy and other cleanup methods. Even if you did override the destroy and socket disconnects it would be poor programming to not release those resources when a user navigated away from the page.

As Ed sugested your best bet is to load the applet in a frame, you can go the ajax route but no sense in rewriting the page when you can just split it into different frames and keep the reload in place.

Knife-Action-Jesus