1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-26 13:56:12 -04:00

respond to system signals

This commit is contained in:
v2ray 2016-05-10 15:51:38 -07:00
parent 8fbca309df
commit 61ce85435f

View File

@ -4,9 +4,8 @@ import (
"flag" "flag"
"fmt" "fmt"
"os" "os"
"os/signal"
"path/filepath" "path/filepath"
"runtime"
"time"
"github.com/v2ray/v2ray-core" "github.com/v2ray/v2ray-core"
_ "github.com/v2ray/v2ray-core/app/router/rules" _ "github.com/v2ray/v2ray-core/app/router/rules"
@ -94,7 +93,9 @@ func main() {
return return
} }
for range time.Tick(time.Minute) { osSignals := make(chan os.Signal, 1)
runtime.GC() signal.Notify(osSignals, os.Interrupt, os.Kill)
}
<-osSignals
vPoint.Close()
} }