• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

browser running in background

 
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.
I am very confused and hope you can help me.
I have an applet that extends class Applet and talks to a remote server via sockets. I use the same basic protocol as in Sun's tutorial on sockets (make the connection to the remote machine, open input and output streams and talk back and forth). In general, this works fine. I check for all possible exceptions and get the behavior I expect from the server.
I have a disconnect button in my applet. When the user clicks this button, the applet:
(1) sends a disconnect message to the server.
(2) closes its input stream
(3) closes its output stream
(4) closes its socket.
This is the exact reverse order from which they were opened.
Now, here is the problem. Sometimes, and I am not sure why,
I will hit the disconnect button and then close my browser. This works and there are no errors or warnings. The browser disappears from the screen. However, the browser doesn't really close. It is still running somewhere in the background. I have to go in and kill it with the Task Manager.
I fear there is some sort of cleanup I need to do which I am neglecting. It is the only explanation I can come up with, but I don't know why this is occurring. Just to be safe, I added the calls to disconnect from the server and close the streams and sockets to my applet's destroy() method (in case the user forgot to disconnect using the button).
I am using JDK 1.2.2 on a WindowsNT 4.0 system. The browser which has this behavior is Netscape 4.73.
If anyone has any advice or insight I would really appreciate it.
Thanks in advance.
Stephanie
 
Sheriff
Posts: 440
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Stephanie,
I am wondering if this is really an applet problem. The reason is because about one out of every ten times that I close Netscape (without applets running), I get the exact same browser behaviour. I havn't looked at Netscape's support site yet but I'm guessing that this may very well be a browser issue.
Does your problem happen when you run it in IE? Let me know and I'll investigate Netscape and see if this type of bug has been reported.
Talk to you soon,
Matt
 
Stephanie Grasson
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Matt,
Thank you very much for your reply! At least now I know I'm not the only one this is happening to.
I tried your suggestion about using IE and it does NOT seem to exhibit this problem behavior. Unfortunately, most of our users use Netscape, so I do need to track the problem down and solve it for that browser.
I tried digging into Netscape's documentation on known bugs, but didn't find any matches yet.
If you hear of anything, I would really appreciate your input.
Thanks again.
Stephanie
 
Matt Midcap
Sheriff
Posts: 440
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Stephanie,
I can't find the bug on Netscape's site either. Another suggestion is to make sure that you are overriding the stop() method in your applet to explicitly stop any threads in the applet. Otherwise they will continue to run and consume browser cycles even after you leave the page.
Hope this helps!
Matt
[This message has been edited by Matt Midcap (edited August 31, 2000).]
 
Stephanie Grasson
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Matt,
Thanks for your efforts.
I did try Netscape's free email help, which claims to give you a response within 24 hours. (That was days ago, and I haven't received a response, but you really can't complain about a browser that you can download for free).
Anyway, I did try overriding the stop() method, but to no avail. I still have the sporadic browser-running-in-background problem. If you hear of or think of any other solutions, I would really appreciate your input.
Thanks again.
Stephanie
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Stephanie Grasson:
Hi all.
I am very confused and hope you can help me.
I have an applet that extends class Applet and talks to a remote server via sockets. I use the same basic protocol as in Sun's tutorial on sockets (make the connection to the remote machine, open input and output streams and talk back and forth). In general, this works fine. I check for all possible exceptions and get the behavior I expect from the server.
I have a disconnect button in my applet. When the user clicks this button, the applet:
(1) sends a disconnect message to the server.
(2) closes its input stream
(3) closes its output stream
(4) closes its socket.
This is the exact reverse order from which they were opened.
Now, here is the problem. Sometimes, and I am not sure why,
I will hit the disconnect button and then close my browser. This works and there are no errors or warnings. The browser disappears from the screen. However, the browser doesn't really close. It is still running somewhere in the background. I have to go in and kill it with the Task Manager.
I fear there is some sort of cleanup I need to do which I am neglecting. It is the only explanation I can come up with, but I don't know why this is occurring. Just to be safe, I added the calls to disconnect from the server and close the streams and sockets to my applet's destroy() method (in case the user forgot to disconnect using the button).
I am using JDK 1.2.2 on a WindowsNT 4.0 system. The browser which has this behavior is Netscape 4.73.
If anyone has any advice or insight I would really appreciate it.
Thanks in advance.
Stephanie


 
PI day is 3.14 (march 14th) and is also einstein's birthday. And this is merely a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic