Răsfoiți Sursa

p2p/nat: add docs for discover

Felix Lange 10 ani în urmă
părinte
comite
f570b68ed1
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      p2p/nat/natupnp.go

+ 3 - 0
p2p/nat/natupnp.go

@@ -133,6 +133,9 @@ func discoverUPnP() Interface {
 	return nil
 }
 
+// finds devices matching the given target and calls matcher for all
+// advertised services of each device. The first non-nil service found
+// is sent into out. If no service matched, nil is sent.
 func discover(out chan<- *upnp, target string, matcher func(*goupnp.RootDevice, goupnp.ServiceClient) *upnp) {
 	devs, err := goupnp.DiscoverDevices(target)
 	if err != nil {