In <URL:news:local.News> on Tue 02 Sep, Ian Bicking wrote:
> On Friday, August 29, 2003, at 02:45 PM, Dietmar Schwertberger wrote:
> > I have some long running applets. If the user cancels the transfer I 
> > would
> > like to stop further execution.
> >
> > I can see
> >  StreamOut Error: (10053, 'Software caused connection abort")
> > in the console window.
> >
> > Can the applet get this information to cancel execution?
> 
> (I assume you mean servlets)
> 
> sleep() should be called regardless of any exceptions.  So this should 
> work (untested):
> 
>      def writeHTML(self):
>          self.finishedLongThing = 0
>          while 1:
>              output = self.doSomethingLong()
>              if not output: break
>              self.write(output)
>          self.finishedLongThing = 1
> 
>      def sleep(self, trans):
>          if not self.finishedLongThing:
>              self.killSomethingLong()
> 
> If the particular exception you're getting causes sleep() not to be 
> called, then that's a bug.

I thought that 'StreamOut Error' is a message from mod_python which is just
printed to stderr. But then there's the post from Matt/Geoff suggesting this
is an OS problem.

The servlet doesn't notice any exception or error.
It continues serving until it has finishedLongThing even if the user's
browser stopped receiving the output long before ...
sleep() will be called afterwards, but then the (useless) work already
has been done.
This is especially a problem because a user may do several cancels and
reloads ...


Regards,

Dietmar



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to