Return io.ErrClosedPipe from closed udpMuxedConn

This commit is contained in:
Paul Wells
2024-04-30 04:05:27 -07:00
parent 75ca3a2c3a
commit d30f13f235
+2 -2
View File
@@ -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
@@ -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
}
}
}