mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-25 19:13:52 +00:00
Don't nil peerconnection while receiving ICE
This commit is contained in:
parent
1b82c48dc1
commit
a8d47fd1bf
1 changed files with 3 additions and 1 deletions
|
|
@ -185,6 +185,9 @@ func (p *Peer) handleICEState(onConnect func()) func(webrtc.ICEConnectionState)
|
|||
}
|
||||
|
||||
func (p *Peer) AddCandidate(candidate string, decoder Decoder) error {
|
||||
// !to add test when the connection is closed but it is still
|
||||
// receiving ice candidates
|
||||
|
||||
var iceCandidate webrtc.ICECandidateInit
|
||||
if err := decoder(candidate, &iceCandidate); err != nil {
|
||||
return err
|
||||
|
|
@ -204,7 +207,6 @@ func (p *Peer) Disconnect() {
|
|||
// ignore this due to DTLS fatal: conn is closed
|
||||
_ = p.conn.Close()
|
||||
}
|
||||
p.conn = nil
|
||||
p.log.Debug().Msg("WebRTC stop")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue