Skip to content

Commit

Permalink
Merge pull request #287 from libp2p/update-tcp
Browse files Browse the repository at this point in the history
update go-tcp-transport to v0.4.0
  • Loading branch information
marten-seemann committed Oct 18, 2021
2 parents 6d9ce0e + c3cd06d commit e18a6bf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions p2p/net/swarm/testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@ func GenSwarm(t *testing.T, opts ...Option) *swarm.Swarm {
upgrader.ConnGater = cfg.connectionGater

if !cfg.disableTCP {
tcpTransport := tcp.NewTCPTransport(upgrader)
tcpTransport.DisableReuseport = cfg.disableReuseport
var tcpOpts []tcp.Option
if cfg.disableReuseport {
tcpOpts = append(tcpOpts, tcp.DisableReuseport())
}
tcpTransport, err := tcp.NewTCPTransport(upgrader, tcpOpts...)
require.NoError(t, err)
if err := s.AddTransport(tcpTransport); err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit e18a6bf

Please sign in to comment.