chore: decrease direct udp read memory used for no-windows platform

This commit is contained in:
wwqgtxx
2023-05-11 13:47:51 +08:00
parent d9fa051dd8
commit 75cd72385a
8 changed files with 178 additions and 17 deletions

View File

@@ -0,0 +1,15 @@
//go:build windows
package net
import (
"net"
)
type enhanceUDPConn struct {
*net.UDPConn
}
func (c *enhanceUDPConn) WaitReadFrom() (data []byte, put func(), addr net.Addr, err error) {
return waitReadFrom(c.UDPConn)
}