Closed linkerlin closed 7 years ago
func (m *natmap) Add(peer net.Addr, dst, src net.PacketConn, srcIncluded bool) { m.Set(peer.String(), src) go func() { timedCopy(dst, peer, src, m.timeout, srcIncluded) if pc := m.Del(peer.String()); pc != nil { pc.Close() } }() }
func (m *natmap) Add(peer net.Addr, dst, src net.PacketConn, srcIncluded bool) { m.Set(peer.String(), src)
go func() { timedCopy(dst, peer, src, m.timeout, srcIncluded) if pc := m.Del(peer.String()); pc != nil { pc.Close() } }() }
Every udp packet need a goroutine.
Every udp packet need a goroutine.