Skip to content

Commit

Permalink
Unregister / remove subscriber if reconnection didn't work.
Browse files Browse the repository at this point in the history
Partial fix from strukturag#15.
  • Loading branch information
fancycode committed Aug 13, 2020
1 parent beb84b9 commit 0dcb9f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/signaling/mcu_janus.go
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,10 @@ retry:
var roomId uint64
handle, roomId, err = p.mcu.getOrCreateSubscriberHandle(ctx, p.publisher, p.streamType)
if err != nil {
// Reconnection didn't work, need to unregister/remove subscriber
// so a new object will be created if the request is retried.
p.mcu.unregisterClient(p)
p.listener.SubscriberClosed(p)
callback(fmt.Errorf("Already connected as subscriber for %s, error during re-joining: %s", p.streamType, err), nil)
return
}
Expand Down

0 comments on commit 0dcb9f6

Please sign in to comment.