Always run seeder and leecher on the same ports, to flex dht.Socket.CloseNow

This commit is contained in:
Matt Joiner 2016-07-30 00:42:22 +10:00
parent 1ca2e7e95a
commit 534275b625
1 changed files with 2 additions and 0 deletions

View File

@ -343,6 +343,7 @@ func testClientTransfer(t *testing.T, ps testClientTransferParams) {
// Create seeder and a Torrent.
cfg := TestingConfig
cfg.Seed = true
cfg.ListenAddr = "localhost:4000"
if ps.SeederStorage != nil {
cfg.DefaultStorage = ps.SeederStorage(greetingTempDir)
} else {
@ -362,6 +363,7 @@ func testClientTransfer(t *testing.T, ps testClientTransferParams) {
require.NoError(t, err)
defer os.RemoveAll(leecherDataDir)
cfg.DefaultStorage = ps.LeecherStorage(leecherDataDir)
cfg.ListenAddr = "localhost:4001"
leecher, err := NewClient(&cfg)
require.NoError(t, err)
defer leecher.Close()