> Remy wrote:
> > outputStream.close() closes the socket itself.
>
> Granted. Since I haven't actually used it, how is
> Socket.shutdownOutput() different from closing down the
> socket? Does it still allow reading from the input stream?

Yes. It only closes half of the socket.

> According to the 1.3 Javadocs, shutdownOutput() causes the
> socket to send remaining data, the TCP termination
> sequence, and respond to any further attempts to write data
> with an IOException.

That's ok, since after sending the request I'm only interested in reading
the response.
Basically, all that is needed is to send an EOF on the socket ouput after
sending the request body when no content-length is specified (that's the
HTTP/1.0 way of ending the request body).

I looked in the code of HTTPClient, and apparently it forces you to set the
content length of the request (which solves the problem).

Remy

Reply via email to