Skip to content

Commit

Permalink
Extract SetReadDeadline from Reader to fix back compat
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniels committed Dec 12, 2022
1 parent 6d03d00 commit 90f6b24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions datachannel.go
Expand Up @@ -19,6 +19,10 @@ const receiveMTU = 8192
// that also returns if the message is text.
type Reader interface {
ReadDataChannel([]byte) (int, bool, error)
}

// ReadDeadliner extends an io.Reader to expose setting a read deadline.
type ReadDeadliner interface {
SetReadDeadline(time.Time) error
}

Expand Down

0 comments on commit 90f6b24

Please sign in to comment.