MCPcopy Create free account
hub / github.com/encodeous/nylon / NewStdNetBind

Function NewStdNetBind

polyamide/conn/bind_std.go:52–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50}
51
52func NewStdNetBind() Bind {
53 return &StdNetBind{
54 udpAddrPool: sync.Pool{
55 New: func() any {
56 return &net.UDPAddr{
57 IP: make([]byte, 16),
58 }
59 },
60 },
61
62 msgsPool: sync.Pool{
63 New: func() any {
64 // ipv6.Message and ipv4.Message are interchangeable as they are
65 // both aliases for x/net/internal/socket.Message.
66 msgs := make([]ipv6.Message, IdealBatchSize)
67 for i := range msgs {
68 msgs[i].Buffers = make(net.Buffers, 1)
69 msgs[i].OOB = make([]byte, 0, stickyControlSize+gsoControlSize)
70 }
71 return &msgs
72 },
73 },
74 }
75}
76
77type StdNetEndpoint struct {
78 // AddrPort is the endpoint destination.

Callers 3

NewDefaultBindFunction · 0.85
NewWinRingBindFunction · 0.85

Calls

no outgoing calls

Tested by 1