server: move address into Server struct

This commit is contained in:
aler9
2021-10-30 16:24:04 +02:00
committed by Alessandro Ros
parent 2882bacdf2
commit 1f5dec4a02
6 changed files with 115 additions and 66 deletions

View File

@@ -159,9 +159,10 @@ func TestServerPublishErrorAnnounce(t *testing.T) {
}, nil
},
},
RTSPAddress: "localhost:8554",
}
err := s.Start("localhost:8554")
err := s.Start()
require.NoError(t, err)
defer s.Wait()
defer s.Close()
@@ -246,9 +247,10 @@ func TestServerPublishSetupPath(t *testing.T) {
}, nil, nil
},
},
RTSPAddress: "localhost:8554",
}
err := s.Start("localhost:8554")
err := s.Start()
require.NoError(t, err)
defer s.Wait()
defer s.Close()
@@ -342,9 +344,10 @@ func TestServerPublishErrorSetupDifferentPaths(t *testing.T) {
}, nil, nil
},
},
RTSPAddress: "localhost:8554",
}
err := s.Start("localhost:8554")
err := s.Start()
require.NoError(t, err)
defer s.Wait()
defer s.Close()
@@ -425,9 +428,10 @@ func TestServerPublishErrorSetupTrackTwice(t *testing.T) {
}, nil, nil
},
},
RTSPAddress: "localhost:8554",
}
err := s.Start("localhost:8554")
err := s.Start()
require.NoError(t, err)
defer s.Wait()
defer s.Close()
@@ -525,9 +529,10 @@ func TestServerPublishErrorRecordPartialTracks(t *testing.T) {
}, nil
},
},
RTSPAddress: "localhost:8554",
}
err := s.Start("localhost:8554")
err := s.Start()
require.NoError(t, err)
defer s.Wait()
defer s.Close()
@@ -654,6 +659,7 @@ func TestServerPublish(t *testing.T) {
ctx.Session.WritePacketRTCP(0, []byte{0x09, 0x0A, 0x0B, 0x0C})
},
},
RTSPAddress: "localhost:8554",
}
switch transport {
@@ -667,7 +673,7 @@ func TestServerPublish(t *testing.T) {
s.TLSConfig = &tls.Config{Certificates: []tls.Certificate{cert}}
}
err := s.Start("localhost:8554")
err := s.Start()
require.NoError(t, err)
defer s.Wait()
defer s.Close()
@@ -967,9 +973,10 @@ func TestServerPublishErrorInvalidProtocol(t *testing.T) {
},
UDPRTPAddress: "127.0.0.1:8000",
UDPRTCPAddress: "127.0.0.1:8001",
RTSPAddress: "localhost:8554",
}
err := s.Start("localhost:8554")
err := s.Start()
require.NoError(t, err)
defer s.Wait()
defer s.Close()
@@ -1069,9 +1076,10 @@ func TestServerPublishRTCPReport(t *testing.T) {
},
},
receiverReportPeriod: 1 * time.Second,
RTSPAddress: "localhost:8554",
}
err := s.Start("localhost:8554")
err := s.Start()
require.NoError(t, err)
defer s.Wait()
defer s.Close()
@@ -1224,6 +1232,7 @@ func TestServerPublishTimeout(t *testing.T) {
},
},
ReadTimeout: 1 * time.Second,
RTSPAddress: "localhost:8554",
}
if transport == "udp" {
@@ -1231,7 +1240,7 @@ func TestServerPublishTimeout(t *testing.T) {
s.UDPRTCPAddress = "127.0.0.1:8001"
}
err := s.Start("localhost:8554")
err := s.Start()
require.NoError(t, err)
defer s.Wait()
defer s.Close()
@@ -1353,6 +1362,7 @@ func TestServerPublishWithoutTeardown(t *testing.T) {
},
},
ReadTimeout: 1 * time.Second,
RTSPAddress: "localhost:8554",
}
if transport == "udp" {
@@ -1360,7 +1370,7 @@ func TestServerPublishWithoutTeardown(t *testing.T) {
s.UDPRTCPAddress = "127.0.0.1:8001"
}
err := s.Start("localhost:8554")
err := s.Start()
require.NoError(t, err)
defer s.Wait()
defer s.Close()
@@ -1474,9 +1484,10 @@ func TestServerPublishUDPChangeConn(t *testing.T) {
},
UDPRTPAddress: "127.0.0.1:8000",
UDPRTCPAddress: "127.0.0.1:8001",
RTSPAddress: "localhost:8554",
}
err := s.Start("localhost:8554")
err := s.Start()
require.NoError(t, err)
defer s.Wait()
defer s.Close()