Skip to content

Commit 6fe2b45

Browse files
committed
Fix the problem of OMM Killer triggered by too many UDP connections
1 parent 1b37096 commit 6fe2b45

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

common/uot/server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/binary"
55
"io"
66
"net"
7+
"time"
78

89
"github.com/sagernet/sing/common"
910
"github.com/sagernet/sing/common/buf"
@@ -89,6 +90,7 @@ func (c *ServerConn) loopInput() {
8990
if err != nil {
9091
break
9192
}
93+
c.SetDeadline(time.Now().Add(2 * time.Minute))
9294
}
9395
c.Close()
9496
}
@@ -105,6 +107,7 @@ func (c *ServerConn) loopOutput() {
105107
if err != nil {
106108
break
107109
}
110+
c.SetDeadline(time.Now().Add(2 * time.Minute))
108111
if !c.isConnect {
109112
err = AddrParser.WriteAddrPort(c.outputWriter, M.SocksaddrFromNet(addr))
110113
if err != nil {

0 commit comments

Comments
 (0)