Re: [Simpleweb-Support] Connection reset
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2005-07-11 10:32:28
|
Hi Jan,
This could be a number of things, I notice that you
have wrapped the Respose.getOutputStream in a
LoggingOutputStream, perhaps this is doing something!
Anyway, this type of error can happen if the browser
or client closes the connection while the data is
being sent, it can also happen if the browser is
refreshed as the content is being sent. The cause is
that the client closes its side of the socket before
the server has finished sending. There should be no
problem on the server side!
Regards
Niall
--- Jan Mikkelsen <jm...@ad...> wrote:
> Hi
>
> I get this exception a lot:
> 2005-07-10 09:09:35,674 WARN [Thread-22]
> (LoggingOutputStream.java:167) -
> java.net.SocketException: Connection reset
> 2005-07-10 09:09:35,674 WARN [Thread-22]
> (LoggingOutputStream.java:167) - at
> java.net.SocketOutputStream.socketWrite(Unknown
> Source)
> 2005-07-10 09:09:35,675 WARN [Thread-22]
> (LoggingOutputStream.java:167) - at
> java.net.SocketOutputStream.write(Unknown Source)
> 2005-07-10 09:09:35,675 WARN [Thread-22]
> (LoggingOutputStream.java:167) - at
> simple.http.MonitoredResponse.commit(Unknown Source)
> 2005-07-10 09:09:35,675 WARN [Thread-22]
> (LoggingOutputStream.java:167) - at
> simple.http.MonitoredResponse.ensureCommit(Unknown
> Source)
> 2005-07-10 09:09:35,675 WARN [Thread-22]
> (LoggingOutputStream.java:167) - at
>
simple.http.MonitoredResponse.getOutputChannel(Unknown
> Source)
> 2005-07-10 09:09:35,675 WARN [Thread-22]
> (LoggingOutputStream.java:167) - at
> simple.http.ResponseStream.getOutputStream(Unknown
> Source)
> 2005-07-10 09:09:35,676 WARN [Thread-22]
> (LoggingOutputStream.java:167) - at
> simple.http.ResponseStream.flushBuffer(Unknown
> Source)
> 2005-07-10 09:09:35,676 WARN [Thread-22]
> (LoggingOutputStream.java:167) - at
> simple.http.ResponseStream.close(Unknown Source)
>
> Here is my code:
>
> private void sendImage(Response resp,
> ByteArrayOutputStream bo, Image image,
> String imageName) throws IOException {
> OutputStream out = resp.getOutputStream(bo.size() +
> 1024);
> bo.writeTo(out);
> resp.set("Content-disposition",
> "attachement;filename=" +imageName);
> resp.set("Pragma", "no-cache");
> resp.set("Cache-Control", "no-cache");
> resp.set("Expires", "0");
> resp.set("Content-Type", image.getContentType());
> out.close();
> }
>
> I hope that somebody on this list can spot an error
> here.
>
> Jan
>
>
>
-------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With
> Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to
> explore the latest in dual
> core and dual graphics technology at this free one
> hour event hosted by HP,
> AMD, and NVIDIA. To register visit
> http://www.hp.com/go/dualwebinar
> _______________________________________________
> Simpleweb-Support mailing list
> Sim...@li...
>
https://lists.sourceforge.net/lists/listinfo/simpleweb-support
>
Niall Gallagher
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
|