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 89d2c47 commit 51293a0
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 @@ -88,7 +88,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 @@ -97,7 +97,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 51293a0

Please sign in to comment.