From d30f13f235b22e46e70a6b57c28a4256545f4729 Mon Sep 17 00:00:00 2001 From: Paul Wells Date: Tue, 30 Apr 2024 03:49:13 -0700 Subject: [PATCH] Return io.ErrClosedPipe from closed udpMuxedConn --- udp_muxed_conn.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/udp_muxed_conn.go b/udp_muxed_conn.go index 4e6588d..ba3297b 100644 --- a/udp_muxed_conn.go +++ b/udp_muxed_conn.go @@ -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 } } }