update go-tcp-transport to v0.4.0
This commit is contained in:
parent
6d9ce0e3cf
commit
c3cd06d61c
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue