Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problem closing connection in HTTPServletResponse

Thread Tools

Problem closing connection in HTTPServletResponse

Naresh Agarwal
Posts: n/a

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

Thus server is not closing the socket even after closing the

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,
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
HttpServletResponse Java 2 12-08-2004 08:20 PM
HttpServletResponse - does sendError terminate request stream? Tim Java 0 10-19-2004 03:57 PM
what is the relation between HTTPServletResponse setContentLength header and keep-alive Naresh Agarwal Java 1 05-29-2004 10:01 AM
javax.servlet.http.HttpServletResponse.sendError() nullyfies any addHeader() Joerg Mueller-Tolk Java 2 12-03-2003 02:03 PM
HttpServletResponse.sendError Mike Landis Java 1 08-09-2003 12:53 AM