fix: reset UDP read deadline on write activity to prevent idle timeout
This commit is contained in:
@@ -140,6 +140,8 @@ func Forwarder(dstAddr *net.UDPAddr, readCh <-chan *msg.UDPPacket, sendCh chan<-
|
|||||||
_, err = udpConn.Write(buf)
|
_, err = udpConn.Write(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
udpConn.Close()
|
udpConn.Close()
|
||||||
|
} else {
|
||||||
|
_ = udpConn.SetReadDeadline(time.Now().Add(30 * time.Second))
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user