Problem closing connection in HTTPServletResponse

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Naresh Agarwal

    Problem closing connection in HTTPServletResponse

    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
  • Raymond DeCampo

    #2
    Re: Problem closing connection in HTTPServletResp onse

    Naresh Agarwal wrote:[color=blue]
    > 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?
    >[/color]

    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

    Comment

    Working...