Skip to content

Commit

Permalink
only close if connection is not shared
Browse files Browse the repository at this point in the history
  • Loading branch information
bashar-515 committed Jan 30, 2025
1 parent 933dcaf commit 33b1814
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rpc/wrtc_signaling_answerer.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,11 @@ func (ans *webrtcSignalingAnswerer) Stop() {
ans.connMu.Lock()
defer ans.connMu.Unlock()
if ans.conn != nil {
err := ans.conn.Close()
if isNetworkError(err) {
ans.logger.Errorw("error closing signaling connection", "error", err)
if !ans.sharedConn {
err := ans.conn.Close()
if isNetworkError(err) {
ans.logger.Errorw("error closing signaling connection", "error", err)
}
}
ans.conn = nil
}
Expand Down

0 comments on commit 33b1814

Please sign in to comment.