1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-11-23 12:02:58 -05: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"
"fmt"
"os"
"os/signal"
"path/filepath"
"runtime"
"time"
"github.com/v2ray/v2ray-core"
_ "github.com/v2ray/v2ray-core/app/router/rules"
@@ -94,7 +93,9 @@ func main() {
return
}
for range time.Tick(time.Minute) {
runtime.GC()
}
osSignals := make(chan os.Signal, 1)
signal.Notify(osSignals, os.Interrupt, os.Kill)
<-osSignals
vPoint.Close()
}