Re: Peformance on socket reads

2009-05-15 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, On 5/15/2009 2:28 PM, David kerber wrote: > > The content-type is application/binary. I might have used "application/octet-stream", but it's really just semantics. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment

Re: Peformance on socket reads

2009-05-15 Thread David kerber
David kerber wrote: Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, On 5/14/2009 8:34 AM, David kerber wrote: len = req.getContentLength(); b = new byte[ len ]; Don't forget to check to see if getContentLength() returned zero. I do, it's just n

RE: Peformance on socket reads

2009-05-15 Thread Caldarale, Charles R
> From: David kerber [mailto:dcker...@verizon.net] > Subject: Re: Peformance on socket reads > What method would you suggest? Create the byte array long enough to > handle any possible input and then read without specifying the length? No, keep allocating the byte array based on

Re: Peformance on socket reads

2009-05-15 Thread David kerber
Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, On 5/14/2009 8:34 AM, David kerber wrote: len = req.getContentLength(); b = new byte[ len ]; Don't forget to check to see if getContentLength() returned zero. I do, it's just not in that code snip

Re: Peformance on socket reads

2009-05-15 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, On 5/14/2009 8:34 AM, David kerber wrote: > len = req.getContentLength(); > b = new byte[ len ]; Don't forget to check to see if getContentLength() returned zero. What is the content-type here? Is it application/x-www-form-urlencoded? Are

Re: Peformance on socket reads

2009-05-14 Thread David kerber
Rainer Jung wrote: On 14.05.2009 14:34, David kerber wrote: ... req is my HttpServletRequest iStream is a ServletInputStream Then I have: len = req.getContentLength(); b = new byte[ len ]; iStream = req.getInputStream(); /* this is the line 198 that the above thread dump is

Re: Peformance on socket reads

2009-05-14 Thread Rainer Jung
On 14.05.2009 14:34, David kerber wrote: > This post is a follow-on to my "performance with many small requests" > thread from a couple days ago. > > I have been watching my app, and taking thread dumps when things seem to > be running a bit slower than I would like. Right now, the biggest > bott