diff --git a/client.go b/client.go index 036154ab..2c402198 100644 --- a/client.go +++ b/client.go @@ -230,7 +230,7 @@ func NewClient(cfg *ClientConfig) (cl *Client, err error) { } } - cl.conns, err = listenAll(cl.enabledPeerNetworks(), cl.config.ListenHost, cl.config.ListenPort, cl.config.ProxyURL, cl.firewallCallback) + cl.conns, err = listenAll(allPeerNetworks, cl.config.ListenHost, cl.config.ListenPort, cl.config.ProxyURL, cl.firewallCallback) if err != nil { return } diff --git a/client_test.go b/client_test.go index af3457da..4b74a64b 100644 --- a/client_test.go +++ b/client_test.go @@ -873,37 +873,21 @@ func TestClientDynamicListenPortAllProtocols(t *testing.T) { func TestClientDynamicListenTCPOnly(t *testing.T) { cfg := TestingConfig() cfg.DisableUTP = true + cfg.DisableTCP = false cl, err := NewClient(cfg) require.NoError(t, err) defer cl.Close() assert.NotEqual(t, 0, cl.LocalPort()) - cl.eachListener(func(s socket) bool { - assert.True(t, isTcpNetwork(s.Addr().Network())) - return true - }) } func TestClientDynamicListenUTPOnly(t *testing.T) { cfg := TestingConfig() cfg.DisableTCP = true + cfg.DisableUTP = false cl, err := NewClient(cfg) require.NoError(t, err) defer cl.Close() assert.NotEqual(t, 0, cl.LocalPort()) - cl.eachListener(func(s socket) bool { - assert.True(t, isUtpNetwork(s.Addr().Network())) - return true - }) -} - -func TestClientDynamicListenPortNoProtocols(t *testing.T) { - cfg := TestingConfig() - cfg.DisableTCP = true - cfg.DisableUTP = true - cl, err := NewClient(cfg) - require.NoError(t, err) - defer cl.Close() - assert.Equal(t, 0, cl.LocalPort()) } func totalConns(tts []*Torrent) (ret int) {