Skip to content

Commit

Permalink
Merge pull request #186 from netixx/fix/err-on-transport-end
Browse files Browse the repository at this point in the history
Return an error on channel read when the transport has finished
  • Loading branch information
carlmontanari committed Jun 14, 2024
2 parents 7a34c42 + 853888e commit d244276
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions channel/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ func (c *Channel) Read() ([]byte, error) {
default:
}

if c.readLoopExited {
return nil, util.ErrConnectionError
}

b := c.Q.Dequeue()

if b == nil {
Expand Down

0 comments on commit d244276

Please sign in to comment.