Skip to content

Commit

Permalink
add shutdown to close
Browse files Browse the repository at this point in the history
  • Loading branch information
craymond12 committed Aug 23, 2024
1 parent 64a837f commit 61abac2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sctptransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package webrtc

import (
"context"
"errors"
"io"
"math"
Expand Down Expand Up @@ -153,6 +154,10 @@ func (r *SCTPTransport) Stop() error {
if r.sctpAssociation == nil {
return nil
}

var ctx, _ = context.WithTimeout(context.Background(), 10*time.Second)
r.sctpAssociation.Shutdown(ctx)

Check failure on line 159 in sctptransport.go

View workflow job for this annotation

GitHub Actions / lint / Go

Error return value of `r.sctpAssociation.Shutdown` is not checked (errcheck)

Check failure on line 159 in sctptransport.go

View workflow job for this annotation

GitHub Actions / lint / Go

Error return value of `r.sctpAssociation.Shutdown` is not checked (errcheck)

err := r.sctpAssociation.Close()
if err != nil {
return err
Expand Down

0 comments on commit 61abac2

Please sign in to comment.