Skip to content

Commit

Permalink
enabled leep alives and remove max idle connections and max connectio…
Browse files Browse the repository at this point in the history
…ns per host
  • Loading branch information
ehsan6sha committed May 1, 2024
1 parent 45349b1 commit 25d7ab8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions exchange/fx_exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 25d7ab8

Please sign in to comment.