开发者

ruby HttpClient library closing socket after response with persistent connection?

开发者 https://www.devze.com 2023-01-14 20:53 出处:网络
I\'m using the HTTPClient gem (http://github.com/nahi/httpclient) for ruby, to post data to IIS 6.1. Even though both support HTTP 1.1 it seems to be closing the socket after each request made, rather

I'm using the HTTPClient gem (http://github.com/nahi/httpclient) for ruby, to post data to IIS 6.1. Even though both support HTTP 1.1 it seems to be closing the socket after each request made, rather than using persistent connections. I haven't added any flags to enable persistent connections (mainly because having poked about the source code it appears that they should be enabled by default).

The reason I think the socket is being close is that if I watch the requests in Wireshark once each request is made I see FIN/ACK TCP packets sent from the client to the server, then the same sent back t开发者_开发知识库he other way.

Am I misreading that or does that mean the socket is being closed?


Wikipedia's article on TCP suggests that the FIN/ACK packets are a signal to terminate the connection. Check which of the client or server initiated the sending of the FIN packet - that's the party requesting that the connection is closed.

As you saw in the source, an HTTP 1.1 implementation should assume that connections are persistent by default.

Is the client specifying HTTP 1.1 in its request and is the server responding accordingly?

0

精彩评论

暂无评论...
验证码 换一张
取 消