Skip to content

Commit

Permalink
do not set read deadline when matching udp connection
Browse files Browse the repository at this point in the history
  • Loading branch information
WeidiDeng committed Oct 2, 2024
1 parent ea27408 commit 54cd348
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions layer4/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 54cd348

Please sign in to comment.