mirror of
https://github.com/aler9/gortsplib
synced 2025-10-08 16:40:09 +08:00
add ConnClient.LoopUDP()
This commit is contained in:
@@ -67,21 +67,6 @@ func main() {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
done := make(chan struct{})
|
||||
|
||||
// send periodic keepalive
|
||||
go func() {
|
||||
keepaliveTicker := time.NewTicker(30 * time.Second)
|
||||
for range keepaliveTicker.C {
|
||||
_, err = rconn.Options(u)
|
||||
if err != nil {
|
||||
fmt.Println("connection is closed")
|
||||
close(done)
|
||||
break
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
// receive RTP packets
|
||||
for trackId, l := range rtpListeners {
|
||||
go func(trackId int, l net.PacketConn) {
|
||||
@@ -112,5 +97,5 @@ func main() {
|
||||
}(trackId, l)
|
||||
}
|
||||
|
||||
<-done
|
||||
panic(rconn.LoopUDP(u))
|
||||
}
|
||||
|
Reference in New Issue
Block a user