fix: reset UDP read deadline on write activity to prevent idle timeout

This commit is contained in:
霜冷长河
2026-05-11 20:23:39 +08:00
committed by GitHub
Unverified
parent 8666e3643f
commit ad07d27914
+2
View File
@@ -140,6 +140,8 @@ func Forwarder(dstAddr *net.UDPAddr, readCh <-chan *msg.UDPPacket, sendCh chan<-
_, err = udpConn.Write(buf)
if err != nil {
udpConn.Close()
} else {
_ = udpConn.SetReadDeadline(time.Now().Add(30 * time.Second))
}
if !ok {