Does net/http have connection pool?

閲覧: 6,172 回
最初の未読メッセージにスキップ

Boris Solovyov

未読、
2013/02/06 21:54:132013/02/06
To: golang-nuts
Hi,

Does net/http package pool and reuse connections? In my clients, I see the program hold http connections open to a server even when I have called Response.Body.Close(). If there is no pool (I cannot find one) then maybe I have a bug and I am not closing all.

Feng Shen

未読、
2013/02/06 22:20:172013/02/06
To: golan...@googlegroups.com

Patrick Mylund Nielsen

未読、
2013/02/06 22:20:312013/02/06
To: Boris Solovyov、golang-nuts
It does indeed. See http.Transport and its methods: http://golang.org/pkg/net/http/#Transport


On Thu, Feb 7, 2013 at 3:54 AM, Boris Solovyov <boris.s...@gmail.com> wrote:
Hi,

Does net/http package pool and reuse connections? In my clients, I see the program hold http connections open to a server even when I have called Response.Body.Close(). If there is no pool (I cannot find one) then maybe I have a bug and I am not closing all.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Boris Solovyov

未読、
2013/02/06 22:27:272013/02/06
To: golang-nuts
Thanks! This seems like major feature of net/http that users should know about, but is buried in obscure docs, "Transport can also cache connections for future re-use." Can package maintainers add short sentence like that to main net/http docs please?
全員に返信
投稿者に返信
転送
メッセージは削除されました
メッセージは削除されました
新着メール 0 件