Documentation
¶
Index ¶
Constants ¶
View Source
const ( // RelayBufferSize using for tcp // io.Copy default buffer size is 32 KiB RelayBufferSize = 32 * 1024 // UDPBufferSize using for udp // Most UDPs are smaller than the MTU, and the TUN's MTU // set to 9000, so the UDP Buffer size set to 16Kib UDPBufferSize = 16 * 1024 )
Variables ¶
View Source
var DefaultAllocator = NewAllocator()
Functions ¶
Types ¶
type Allocator ¶
func NewAllocator ¶
func NewAllocator() Allocator
NewAllocator initiates a []byte allocator for frames less than 65536 bytes, the waste(memory fragmentation) of space allocation is guaranteed to be no more than 50%.
Click to show internal directories.
Click to hide internal directories.