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.SetMigrateState(types.MigrateStateComplete)
|
||||||
}
|
}
|
||||||
p.incActiveCounter()
|
p.incActiveCounter()
|
||||||
} else if state == webrtc.PeerConnectionStateDisconnected {
|
} else if state == webrtc.PeerConnectionStateFailed {
|
||||||
// clients support resuming of connections when websocket becomes disconnected
|
// clients support resuming of connections when websocket becomes disconnected
|
||||||
p.closeSignalConnection()
|
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
|
// for the secondary peer connection, we still need to handle when they become disconnected
|
||||||
// instead of allowing them to silently fail.
|
// instead of allowing them to silently fail.
|
||||||
func (p *ParticipantImpl) handleSecondaryStateChange(state webrtc.PeerConnectionState) {
|
func (p *ParticipantImpl) handleSecondaryStateChange(state webrtc.PeerConnectionState) {
|
||||||
if state == webrtc.PeerConnectionStateDisconnected {
|
if state == webrtc.PeerConnectionStateFailed {
|
||||||
// clients support resuming of connections when websocket becomes disconnected
|
// clients support resuming of connections when websocket becomes disconnected
|
||||||
p.closeSignalConnection()
|
p.closeSignalConnection()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ import (
|
|||||||
const (
|
const (
|
||||||
negotiationFrequency = 150 * time.Millisecond
|
negotiationFrequency = 150 * time.Millisecond
|
||||||
dtlsRetransmissionInterval = 100 * 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 (
|
const (
|
||||||
@@ -113,6 +117,7 @@ func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimat
|
|||||||
se.SetLite(false)
|
se.SetLite(false)
|
||||||
}
|
}
|
||||||
se.SetDTLSRetransmissionInterval(dtlsRetransmissionInterval)
|
se.SetDTLSRetransmissionInterval(dtlsRetransmissionInterval)
|
||||||
|
se.SetICETimeouts(iceDisconnectedTimeout, iceFailedTimeout, iceKeepaliveInterval)
|
||||||
|
|
||||||
lf := serverlogger.NewLoggerFactory(logr.Logger(params.Logger))
|
lf := serverlogger.NewLoggerFactory(logr.Logger(params.Logger))
|
||||||
if lf != nil {
|
if lf != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user