How to reuse TCP connection when using a proxy with java.net.http.HttpClient in HTTP/1.1
Nicolas Henneaux
nicolas.henneaux at gmail.com
Mon Jan 11 21:13:37 UTC 2021
Thanks Simone, that makes sense. I haven't thought there is actually no
other way for the server to know the response is fully consumed or not.
Thanks all!
Nicolas
On Mon, 11 Jan 2021 at 22:08, Simone Bordet <simone.bordet at gmail.com> wrote:
> Hi,
>
> On Mon, Jan 11, 2021 at 9:28 PM Nicolas Henneaux
> <nicolas.henneaux at gmail.com> wrote:
> >
> > Hi Daniel,
> >
> > Thanks for your quick feedback.
> >
> > Indeed if I fetch all the bytes, the connection is kept. What's the
> reason behind this behaviour?
>
> It's normal behavior.
>
> The server may have not finished to send all the bytes in case of
> large response contents.
>
> If the client reuses the connection to send another request, when it
> tries to read the response it will find bytes of the previous
> response.
> There is no other way than closing the connection to ensure that the
> next request is not messed up.
> In case you wonder, there are so many other ways to screw things up
> that really, there is no other way than closing the connection :)
>
> --
> Simone Bordet
> ---
> Finally, no matter how good the architecture and design are,
> to deliver bug-free software with optimal performance and reliability,
> the implementation technique must be flawless. Victoria Livschitz
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210111/ce5843c6/attachment.htm>
More information about the net-dev
mailing list