fix firefox reconnect with ice-lite enabled (#565)
This commit is contained in:
@@ -982,7 +982,7 @@ func (p *ParticipantImpl) handlePrimaryStateChange(state webrtc.PeerConnectionSt
|
||||
p.SetMigrateState(types.MigrateStateComplete)
|
||||
}
|
||||
p.incActiveCounter()
|
||||
} else if state == webrtc.PeerConnectionStateDisconnected {
|
||||
} else if state == webrtc.PeerConnectionStateFailed {
|
||||
// clients support resuming of connections when websocket becomes disconnected
|
||||
p.closeSignalConnection()
|
||||
|
||||
@@ -1018,7 +1018,7 @@ func (p *ParticipantImpl) handlePrimaryStateChange(state webrtc.PeerConnectionSt
|
||||
// for the secondary peer connection, we still need to handle when they become disconnected
|
||||
// instead of allowing them to silently fail.
|
||||
func (p *ParticipantImpl) handleSecondaryStateChange(state webrtc.PeerConnectionState) {
|
||||
if state == webrtc.PeerConnectionStateDisconnected {
|
||||
if state == webrtc.PeerConnectionStateFailed {
|
||||
// clients support resuming of connections when websocket becomes disconnected
|
||||
p.closeSignalConnection()
|
||||
}
|
||||
|
||||
@@ -28,6 +28,10 @@ import (
|
||||
const (
|
||||
negotiationFrequency = 150 * time.Millisecond
|
||||
dtlsRetransmissionInterval = 100 * time.Millisecond
|
||||
|
||||
iceDisconnectedTimeout = 10 * time.Second // compatible for ice-lite with firefox client
|
||||
iceFailedTimeout = 25 * time.Second // pion's default
|
||||
iceKeepaliveInterval = 2 * time.Second // pion's default
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -113,6 +117,7 @@ func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimat
|
||||
se.SetLite(false)
|
||||
}
|
||||
se.SetDTLSRetransmissionInterval(dtlsRetransmissionInterval)
|
||||
se.SetICETimeouts(iceDisconnectedTimeout, iceFailedTimeout, iceKeepaliveInterval)
|
||||
|
||||
lf := serverlogger.NewLoggerFactory(logr.Logger(params.Logger))
|
||||
if lf != nil {
|
||||
|
||||
Reference in New Issue
Block a user