You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Garth Patil <ga...@gmail.com> on 2006/06/30 23:22:28 UTC

Serving files to Windows Media Player -- ClientAbortException: java.net.SocketException: Broken pipe (or) Connection reset

Hi all,
I'm trying to debug an application that serves small (20-100k) media
files of various types (.swf, .wmv) to Windows Media Player (primarily
versions 9, 10, 11). The problem I'm experiencing is that I'm seeing a
SocketException with about 50% of the requests. I get one of the two
following log messages:
ClientAbortException:  java.net.SocketException: Broken pipe
ClientAbortException:  java.net.SocketException: Connection reset

Here is the servlet code that is being run when the exception occurs:
FileInputStream in = new FileInputStream(file);
OutputStream out = resp.getOutputStream();
byte[] buf = new byte[4096];
int count = 0;
while ((count = in.read(buf)) >= 0) {
  out.write(buf, 0, count);
}
in.close();
out.flush();
out.close();

I've scoured this and other forums, and I've only found the
explanation that "this means the client is closing the connection
before the server can send all the bytes". I'd be willing to believe
this if it weren't happening to 50% of 600,000 requests per day. Has
anyone else seen this problem? Any ideas on what's going on?
Best,
Garth

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Serving files to Windows Media Player -- ClientAbortException: java.net.SocketException: Broken pipe (or) Connection reset

Posted by Garth Patil <ga...@gmail.com>.
Thanks Hassan.
Windows Media Player actually supports Flash files up to flash version 6.
Best,
Garth

On 6/30/06, Hassan Schroeder <ha...@gmail.com> wrote:
> On 6/30/06, Garth Patil <ga...@gmail.com> wrote:
>
> > I'm trying to debug an application that serves small (20-100k) media
> > files of various types (.swf, .wmv) to Windows Media Player (primarily
> > versions 9, 10, 11). The problem I'm experiencing is that I'm seeing a
> > SocketException with about 50% of the requests.
>
> You're sending Flash files to Windows Media Player?? I can imagine
> that resulting in a closed connection  :-)
>
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Serving files to Windows Media Player -- ClientAbortException: java.net.SocketException: Broken pipe (or) Connection reset

Posted by Hassan Schroeder <ha...@gmail.com>.
On 6/30/06, Garth Patil <ga...@gmail.com> wrote:

> I'm trying to debug an application that serves small (20-100k) media
> files of various types (.swf, .wmv) to Windows Media Player (primarily
> versions 9, 10, 11). The problem I'm experiencing is that I'm seeing a
> SocketException with about 50% of the requests.

You're sending Flash files to Windows Media Player?? I can imagine
that resulting in a closed connection  :-)

-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org