Hello
Is it problem with the servlets that it take much time to respond. My client is trying to connect to servlet which is sending continuous stream of images through HTTP connection. Do I have to change my servlet engine (I am using tomacat).
Any help will be appreciated.
Thanks
kapil
-
servlet taking much costly time (4 messages)
- Posted by: kapil sharma
- Posted on: June 09 2005 03:48 EDT
Threaded Messages (4)
- mmm by xycleo monk on June 15 2005 06:33 EDT
- response by kapil sharma on June 17 2005 09:20 EDT
-
zip stream by Sowmya Sridhar on June 17 2005 03:37 EDT
- raw image by kapil sharma on June 17 2005 11:55 EDT
-
zip stream by Sowmya Sridhar on June 17 2005 03:37 EDT
- response by kapil sharma on June 17 2005 09:20 EDT
-
mmm[ Go to top ]
- Posted by: xycleo monk
- Posted on: June 15 2005 06:33 EDT
- in response to kapil sharma
I think taking much costly time mayby cause by sorts of reason!can you tell me your servlet do something? -
response[ Go to top ]
- Posted by: kapil sharma
- Posted on: June 17 2005 09:20 EDT
- in response to xycleo monk
Hello
I have Doja application,i-appli (similar to Midlet) which is taking continous stream of images from the servlet running on tomcat engine.
For the servlet sending normal text I got the response in just a 1-2 sec. but for this servlet which is taking the image from Fileinputstream (the real path one)and sending into outputstream, it is taking about 21 sec for HTTP connection OK response
I think i have to optimize code on the servlet side as my client application only supports HTTP protocol.
My servlet code looks like
//sending 5 image files to outputstream
for(i=1;i<=5;i++)
{
filename = sc.getRealPath("pic"+i+".jpeg" ;//get path of pic.
file = new File(filename);
mimeType = sc.getMimeType(filename);
resp.set ontentType(mimeType);
in = new FileInputStream(file);
count = in.read(buf);
out.writ (buf,0,count);
}
in.close );
out.clos ();
}
Can there be any method of putting the byte chunk of images into outputstream faster than this.
Any help wiil be appreciated.
Thanks in advance.
kapes -
zip stream[ Go to top ]
- Posted by: Sowmya Sridhar
- Posted on: June 17 2005 15:37 EDT
- in response to kapil sharma
Why dont u zip the contents and dump them into the output stream - and on the client side, unzip them -
raw image[ Go to top ]
- Posted by: kapil sharma
- Posted on: June 17 2005 23:55 EDT
- in response to Sowmya Sridhar
Hello,
I want to take the raw image data directly from the inputstream on the client side i.e. reading the stream and then displaying it on the handset through Mediamanager.
I have tried through compression decompression but no such improvement
I think i need to change my code ?
Any help in this regard will be implemented
Thanks
Kapil Sharma