examples: print write errors (#810)

This commit is contained in:
Alessandro Ros
2025-06-28 12:42:37 +02:00
committed by GitHub
parent ebf9912f77
commit f4ef4ec23a
8 changed files with 43 additions and 20 deletions

View File

@@ -78,7 +78,10 @@ func (c *client) read() error {
}
writeToClient := func(pkt *rtp.Packet) {
rc.WritePacketRTP(backChannelMedia, pkt) //nolint:errcheck
err2 := rc.WritePacketRTP(backChannelMedia, pkt)
if err2 != nil {
log.Printf("ERR: %v", err2)
}
}
// setup all medias
@@ -98,7 +101,10 @@ func (c *client) read() error {
log.Printf("received RTP packet from the client, routing to readers")
// route incoming packets to the server stream
stream.WritePacketRTP(medi, pkt) //nolint:errcheck
err2 := stream.WritePacketRTP(medi, pkt)
if err2 != nil {
log.Printf("ERR: %v", err2)
}
})
// start playing