From 54cd3481fe6a4ca2ccc8591b1e0ea69b2762f39b Mon Sep 17 00:00:00 2001 From: Weidi Deng Date: Wed, 2 Oct 2024 14:13:35 +0800 Subject: [PATCH] do not set read deadline when matching udp connection --- layer4/server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layer4/server.go b/layer4/server.go index 05135fb..ce139a5 100644 --- a/layer4/server.go +++ b/layer4/server.go @@ -241,6 +241,12 @@ type packetConn struct { lastBuf *bytes.Buffer } +// SetReadDeadline prevents deadline from being set on the underlying net.PacketConn. +// TODO: works alongside the idle timeout in Read +func (pc *packetConn) SetReadDeadline(time.Time) error { + return nil +} + func (pc *packetConn) Read(b []byte) (n int, err error) { if pc.lastPacket != nil { // There is a partial buffer to continue reading from the previous