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)
| 255 | // It is safe to close conn after calling the method. |
| 256 | // Any existing packet connection with the same address is overwitten. |
| 257 | func (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 | |
| 264 | func (f *Fds) packetConnLocked(network, addr string) (net.PacketConn, error) { |
| 265 | key := fileName{packetKind, network, addr} |