chore: sing inbound support WaitReadPacket

This commit is contained in:
wwqgtxx
2023-05-10 22:35:50 +08:00
parent 3b291d3fbf
commit c58400572c
4 changed files with 63 additions and 17 deletions

View File

@ -32,7 +32,7 @@ func NewUDP(addr string, pickCipher core.Cipher, in chan<- C.PacketAdapter) (*UD
conn := pickCipher.PacketConn(l)
go func() {
for {
buf := pool.Get(pool.RelayBufferSize)
buf := pool.Get(pool.UDPBufferSize)
n, remoteAddr, err := conn.ReadFrom(buf)
if err != nil {
pool.Put(buf)