Skip to content

Commit

Permalink
Return io.EOF from closed udpMuxedConn
Browse files Browse the repository at this point in the history
  • Loading branch information
paulwe committed May 1, 2024
1 parent edb6929 commit ed41bbf
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.ErrClosedPipe
return 0, nil, io.EOF
}

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.ErrClosedPipe
return 0, nil, io.EOF
}
}
}
Expand Down

0 comments on commit ed41bbf

Please sign in to comment.