mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-08-04 14:36:07 +00:00
21 lines
508 B
Go
21 lines
508 B
Go
//go:build !linux
|
|
|
|
package openvpn
|
|
|
|
import "github.com/sagernet/sing/common"
|
|
|
|
const openVPNUDPSocketBufferSize = 7 << 20
|
|
|
|
type openVPNUDPSocketBufferSetter interface {
|
|
SetReadBuffer(bytes int) error
|
|
SetWriteBuffer(bytes int) error
|
|
}
|
|
|
|
func tuneOpenVPNUDPSocket(connection any) {
|
|
bufferSetter, loaded := common.Cast[openVPNUDPSocketBufferSetter](connection)
|
|
if !loaded {
|
|
return
|
|
}
|
|
_ = bufferSetter.SetReadBuffer(openVPNUDPSocketBufferSize)
|
|
_ = bufferSetter.SetWriteBuffer(openVPNUDPSocketBufferSize)
|
|
}
|