Skip to content

Commit

Permalink
Return io.ErrClosedPipe from closed udpMuxedConn
Browse files Browse the repository at this point in the history
  • Loading branch information
paulwe committed Apr 30, 2024
1 parent 75ca3a2 commit d30f13f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions udp_muxed_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (c *udpMuxedConn) ReadFrom(b []byte) (n int, rAddr net.Addr, err error) {

if c.state == udpMuxedConnClosed {
c.mu.Unlock()
return 0, nil, io.EOF
return 0, nil, io.ErrClosedPipe
}

c.state = udpMuxedConnWaiting
Expand All @@ -86,7 +86,7 @@ func (c *udpMuxedConn) ReadFrom(b []byte) (n int, rAddr net.Addr, err error) {
select {
case <-c.notify:
case <-c.closedChan:
return 0, nil, io.EOF
return 0, nil, io.ErrClosedPipe
}
}
}
Expand Down

0 comments on commit d30f13f

Please sign in to comment.