aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-12-01 23:37:26 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-12-01 23:37:26 +0100
commiteaca1ee1f79422a501394415fd4ae8f227a134af (patch)
tree1fbfad20b2e9a6b68d5ccd928ed6678596de76b9 /src/main.go
parentFixed receive path infinite loop (diff)
downloadwireguard-go-eaca1ee1f79422a501394415fd4ae8f227a134af.tar.xz
wireguard-go-eaca1ee1f79422a501394415fd4ae8f227a134af.zip
More consistent use of signal struct
Diffstat (limited to 'src/main.go')
-rw-r--r--src/main.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.go b/src/main.go
index e43176c..8bca78c 100644
--- a/src/main.go
+++ b/src/main.go
@@ -8,6 +8,10 @@ import (
"strconv"
)
+import _ "net/http/pprof"
+import "net/http"
+import "log"
+
const (
ExitSetupSuccess = 0
ExitSetupFailed = 1
@@ -25,6 +29,10 @@ func printUsage() {
func main() {
+ go func() {
+ log.Println(http.ListenAndServe("localhost:6060", nil))
+ }()
+
// parse arguments
var foreground bool
@@ -160,7 +168,6 @@ func main() {
errs := make(chan error)
term := make(chan os.Signal)
- wait := device.WaitChannel()
uapi, err := UAPIListen(interfaceName, fileUAPI)
@@ -183,9 +190,9 @@ func main() {
signal.Notify(term, os.Interrupt)
select {
- case <-wait:
case <-term:
case <-errs:
+ case <-device.Wait():
}
// clean up