MCPcopy
hub / github.com/cloudflare/tableflip / AddPacketConn

Method AddPacketConn

fds.go:257–262  ·  view source on GitHub ↗

AddPacketConn adds a PacketConn. It is safe to close conn after calling the method. Any existing packet connection with the same address is overwitten.

(network, addr string, conn PacketConn)

Source from the content-addressed store, hash-verified

255// It is safe to close conn after calling the method.
256// Any existing packet connection with the same address is overwitten.
257func (f *Fds) AddPacketConn(network, addr string, conn PacketConn) error {
258 f.mu.Lock()
259 defer f.mu.Unlock()
260
261 return f.addSyscallConnLocked(packetKind, network, addr, conn)
262}
263
264func (f *Fds) packetConnLocked(network, addr string) (net.PacketConn, error) {
265 key := fileName{packetKind, network, addr}

Callers 1

TestFdsAddPacketConnFunction · 0.80

Calls 1

addSyscallConnLockedMethod · 0.95

Tested by 1

TestFdsAddPacketConnFunction · 0.64