HTTP 1.1 Persistent Connections using Sockets in Java

前端 未结 5 1246
无人共我
无人共我 2020-12-30 16:45

Let\'s say I have a java program that makes an HTTP request on a server using HTTP 1.1 and doesn\'t close the connection. I make one request, and read all data returned from

5条回答
  •  灰色年华
    2020-12-30 17:06

    Is there a particular reason you're using raw sockets and not Java's URL Connection or Commons HTTPClient?

    HTTP isn't easy to get right. I know Commons HTTP Client can re-use connections like you're trying to do.

    If there isn't a specific reason for you using Sockets this is what I would recommend :)

提交回复
热议问题