Break out UPnP port mapping into a service

This commit is contained in:
Jakob Borg
2015-04-25 20:52:07 +09:00
parent 50d377d9fe
commit 0642402449
6 changed files with 124 additions and 126 deletions

View File

@@ -95,7 +95,6 @@ type upnpRoot struct {
// The order in which the devices appear in the results list is not deterministic.
func Discover(timeout time.Duration) []IGD {
var results []IGD
l.Infoln("Starting UPnP discovery...")
interfaces, err := net.Interfaces()
if err != nil {
@@ -144,13 +143,6 @@ func Discover(timeout time.Duration) []IGD {
wg.Wait()
close(resultChan)
suffix := "devices"
if len(results) == 1 {
suffix = "device"
}
l.Infof("UPnP discovery complete (found %d %s).", len(results), suffix)
return results
}