From 25d7ab85d453128fc5bf5ce6b4a4b4f51ed09a37 Mon Sep 17 00:00:00 2001 From: ehsan shariati Date: Wed, 1 May 2024 22:12:06 +0330 Subject: [PATCH] enabled leep alives and remove max idle connections and max connections per host --- exchange/fx_exchange.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exchange/fx_exchange.go b/exchange/fx_exchange.go index 976cd5a..c183785 100644 --- a/exchange/fx_exchange.go +++ b/exchange/fx_exchange.go @@ -116,10 +116,10 @@ func NewFxExchange(h host.Host, ls ipld.LinkSystem, o ...Option) (*FxExchange, e return nil, err } tr := &http.Transport{ - DisableKeepAlives: true, // Ensure connections are not reused - MaxIdleConns: 500, - MaxConnsPerHost: 2000, - IdleConnTimeout: 20 * time.Second, + DisableKeepAlives: false, // Ensure connections are reused + MaxIdleConns: 0, + MaxConnsPerHost: 0, + IdleConnTimeout: 60 * time.Second, // Include any other necessary transport configuration here } tr.RegisterProtocol("libp2p", p2phttp.NewTransport(h, p2phttp.ProtocolOption(FxExchangeProtocolID)))