mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
client: support reading from servers that use random UDP ports (https://github.com/aler9/rtsp-simple-server/issues/691)
This commit is contained in:
@@ -792,6 +792,7 @@ func TestClientReadAnyPort(t *testing.T) {
|
||||
"zero",
|
||||
"zero_one",
|
||||
"no",
|
||||
"random",
|
||||
} {
|
||||
t.Run(ca, func(t *testing.T) {
|
||||
l, err := net.Listen("tcp", "localhost:8554")
|
||||
@@ -868,8 +869,13 @@ func TestClientReadAnyPort(t *testing.T) {
|
||||
|
||||
case "zero_one":
|
||||
return &[2]int{0, 1}
|
||||
|
||||
case "no":
|
||||
return nil
|
||||
|
||||
default: // random
|
||||
return &[2]int{23040, 23041}
|
||||
}
|
||||
return nil
|
||||
}(),
|
||||
}.Write(),
|
||||
},
|
||||
@@ -887,7 +893,7 @@ func TestClientReadAnyPort(t *testing.T) {
|
||||
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
l1, err := net.ListenPacket("udp", "localhost:0")
|
||||
l1, err := net.ListenPacket("udp", "localhost:13344")
|
||||
require.NoError(t, err)
|
||||
defer l1.Close()
|
||||
|
||||
|
Reference in New Issue
Block a user