By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,554 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,554 IT Pros & Developers. It's quick & easy.

Problem closing connection in HTTPServletResponse

P: n/a
Hi

I'm developing a webapp using servlets, which processes a HTTP Post
request and sent back MIME message (multipart/related - essentially
SOAP message with Attachments).

I'm constructing the MIME message manually (as I need to stream it to
the client) and writing it to OutputStream (few bytes everytime).

In the end, I close the OutputStream, but still client keeps on
waiting on the socket and it never get -1, while it reads from the
InputStream.

Thus server is not closing the socket even after closing the
OutputStream.

This problem occurs only when I set the content type header in servlet
response as multipart/related. The problem does not occur if I've to
send text/xml or multipart/mixed data.

Does anybody has any clue on it?

thanks & regards,
Naresh
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Naresh Agarwal wrote:
Hi

I'm developing a webapp using servlets, which processes a HTTP Post
request and sent back MIME message (multipart/related - essentially
SOAP message with Attachments).

I'm constructing the MIME message manually (as I need to stream it to
the client) and writing it to OutputStream (few bytes everytime).

In the end, I close the OutputStream, but still client keeps on
waiting on the socket and it never get -1, while it reads from the
InputStream.

Thus server is not closing the socket even after closing the
OutputStream.

This problem occurs only when I set the content type header in servlet
response as multipart/related. The problem does not occur if I've to
send text/xml or multipart/mixed data.

Does anybody has any clue on it?


I've seen this problem with certain application server and browser
combinations. For example, JRun 3.0's own admin screen had this problem
when accessed via Netscape.

Experiment with different app servers, browsers and even JVMs.

Ray
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.