diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index 334a37086..39cce9073 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -56,7 +56,7 @@ const ( sdBatchSize = 30 rttUpdateInterval = 5 * time.Second - disconnectCleanupDuration = 15 * time.Second + disconnectCleanupDuration = 5 * time.Second migrationWaitDuration = 3 * time.Second ) @@ -561,7 +561,9 @@ func (p *ParticipantImpl) HandleSignalSourceClose() { p.TransportManager.SetSignalSourceValid(false) if !p.TransportManager.HasPublisherEverConnected() && !p.TransportManager.HasSubscriberEverConnected() { - p.params.Logger.Infow("closing disconnected participant") + p.params.Logger.Infow("closing disconnected participant", + "reason", types.ParticipantCloseReasonJoinFailed, + ) _ = p.Close(false, types.ParticipantCloseReasonJoinFailed, false) } } @@ -1402,7 +1404,9 @@ func (p *ParticipantImpl) setupDisconnectTimer() { if p.IsClosed() || p.IsDisconnected() { return } - p.params.Logger.Infow("closing disconnected participant") + p.params.Logger.Infow("closing disconnected participant", + "reason", types.ParticipantCloseReasonPeerConnectionDisconnected, + ) _ = p.Close(true, types.ParticipantCloseReasonPeerConnectionDisconnected, false) }) p.lock.Unlock() diff --git a/pkg/rtc/transport.go b/pkg/rtc/transport.go index b671649cd..33ba7ade2 100644 --- a/pkg/rtc/transport.go +++ b/pkg/rtc/transport.go @@ -60,7 +60,7 @@ const ( dtlsRetransmissionInterval = 100 * time.Millisecond iceDisconnectedTimeout = 10 * time.Second // compatible for ice-lite with firefox client - iceFailedTimeout = 25 * time.Second // pion's default + iceFailedTimeout = 5 * time.Second // time between disconnected and failed iceKeepaliveInterval = 2 * time.Second // pion's default minTcpICEConnectTimeout = 5 * time.Second