diff options
Diffstat (limited to 'Godeps/_workspace/src/github.com/huin/goupnp/cmd')
3 files changed, 0 insertions, 114 deletions
diff --git a/Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_httpu_serving/example_httpu_serving.go b/Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_httpu_serving/example_httpu_serving.go deleted file mode 100644 index d9d9daa93..000000000 --- a/Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_httpu_serving/example_httpu_serving.go +++ /dev/null @@ -1,20 +0,0 @@ -package main - -import ( - "log" - "net/http" - - "github.com/huin/goupnp/httpu" -) - -func main() { - srv := httpu.Server{ - Addr: "239.255.255.250:1900", - Multicast: true, - Handler: httpu.HandlerFunc(func(r *http.Request) { - log.Printf("Got %s %s message from %v: %v", r.Method, r.URL.Path, r.RemoteAddr, r.Header) - }), - } - err := srv.ListenAndServe() - log.Printf("Serving failed with error: %v", err) -} diff --git a/Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_internetgateway1/example_internetgateway1.go b/Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_internetgateway1/example_internetgateway1.go deleted file mode 100644 index 29e8adc8b..000000000 --- a/Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_internetgateway1/example_internetgateway1.go +++ /dev/null @@ -1,67 +0,0 @@ -package main - -import ( - "fmt" - "log" - - "github.com/huin/goupnp/dcps/internetgateway1" -) - -func main() { - clients, errors, err := internetgateway1.NewWANPPPConnection1Clients() - if err != nil { - log.Fatal(err) - } - - fmt.Printf("Got %d errors finding servers and %d successfully discovered.\n", - len(errors), len(clients)) - for i, e := range errors { - fmt.Printf("Error finding server #%d: %v\n", i+1, e) - } - - for _, c := range clients { - dev := &c.ServiceClient.RootDevice.Device - srv := c.ServiceClient.Service - fmt.Println(dev.FriendlyName, " :: ", srv.String()) - scpd, err := srv.RequestSCDP() - if err != nil { - fmt.Printf(" Error requesting service SCPD: %v\n", err) - } else { - fmt.Println(" Available actions:") - for _, action := range scpd.Actions { - fmt.Printf(" * %s\n", action.Name) - for _, arg := range action.Arguments { - var varDesc string - if stateVar := scpd.GetStateVariable(arg.RelatedStateVariable); stateVar != nil { - varDesc = fmt.Sprintf(" (%s)", stateVar.DataType.Name) - } - fmt.Printf(" * [%s] %s%s\n", arg.Direction, arg.Name, varDesc) - } - } - } - - if scpd == nil || scpd.GetAction("GetExternalIPAddress") != nil { - ip, err := c.GetExternalIPAddress() - fmt.Println("GetExternalIPAddress: ", ip, err) - } - - if scpd == nil || scpd.GetAction("GetStatusInfo") != nil { - status, lastErr, uptime, err := c.GetStatusInfo() - fmt.Println("GetStatusInfo: ", status, lastErr, uptime, err) - } - - if scpd == nil || scpd.GetAction("GetIdleDisconnectTime") != nil { - idleTime, err := c.GetIdleDisconnectTime() - fmt.Println("GetIdleDisconnectTime: ", idleTime, err) - } - - if scpd == nil || scpd.GetAction("AddPortMapping") != nil { - err := c.AddPortMapping("", 5000, "TCP", 5001, "192.168.1.2", true, "Test port mapping", 0) - fmt.Println("AddPortMapping: ", err) - } - if scpd == nil || scpd.GetAction("DeletePortMapping") != nil { - err := c.DeletePortMapping("", 5000, "TCP") - fmt.Println("DeletePortMapping: ", err) - } - } -} diff --git a/Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_ssdp_registry/example_ssdp_registry.go b/Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_ssdp_registry/example_ssdp_registry.go deleted file mode 100644 index 05f0df003..000000000 --- a/Godeps/_workspace/src/github.com/huin/goupnp/cmd/example_ssdp_registry/example_ssdp_registry.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -import ( - "log" - - "github.com/huin/goupnp/ssdp" -) - -func main() { - c := make(chan ssdp.Update) - srv, reg := ssdp.NewServerAndRegistry() - reg.AddListener(c) - go listener(c) - if err := srv.ListenAndServe(); err != nil { - log.Print("ListenAndServe failed: ", err) - } -} - -func listener(c <-chan ssdp.Update) { - for u := range c { - if u.Entry != nil { - log.Printf("Event: %v USN: %s Entry: %#v", u.EventType, u.USN, *u.Entry) - } else { - log.Printf("Event: %v USN: %s Entry: <nil>", u.EventType, u.USN) - } - } -} |