Update examples to handle going to Closed

Relates to #1767
This commit is contained in:
Sean DuBois
2023-09-05 10:44:57 -04:00
committed by Sean DuBois
parent b9c3b86be0
commit f66b8b6ce2
16 changed files with 105 additions and 6 deletions

View File

@@ -100,6 +100,12 @@ func main() {
fmt.Println("Peer Connection has gone to failed exiting")
os.Exit(0)
}
if s == webrtc.PeerConnectionStateClosed {
// PeerConnection was explicitly closed. This usually happens from a DTLS CloseNotify
fmt.Println("Peer Connection has gone to closed exiting")
os.Exit(0)
}
})
// Set the handler for Peer connection state