-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
35 lines (29 loc) · 819 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"os"
"os/signal"
"syscall"
_ "github.com/hkmadao/rtsp2rtmp/src/rtsp2rtmp/conf" // 必须先导入配置文件
"github.com/hkmadao/rtsp2rtmp/src/rtsp2rtmp/rtspclientmanager"
"github.com/hkmadao/rtsp2rtmp/src/rtsp2rtmp/task"
"github.com/hkmadao/rtsp2rtmp/src/rtsp2rtmp/web"
// "net/http"
// _ "net/http/pprof"
"github.com/beego/beego/v2/core/logs"
)
func main() {
rtspclientmanager.GetSingleRtspClientManager().StartClient()
task.GetSingleTask().StartTask()
web.GetSingleWeb().StartWeb()
sigs := make(chan os.Signal, 1)
done := make(chan bool, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
logs.Info("Server Start Awaiting Signal")
// http.ListenAndServe("0.0.0.0:6060", nil)
select {
case sig := <-sigs:
logs.Info(sig)
case <-done:
}
logs.Info("Exiting")
}