示例#1
0
func NewSummary() *Summary {
	s := &Summary{}

	s.Now = time.Now().UnixNano() / int64(time.Millisecond)

	s.Self.Version = core.Version()
	s.Self.Pid = int64(os.Getpid())
	s.Self.Ppid = int64(os.Getppid())

	return s
}
示例#2
0
func serve(svr *app.Server) int {
	if err := svr.PrepareLogger(); err != nil {
		core.Error.Println("prepare logger failed, err is", err)
		return -1
	}

	oryxMain(svr)

	core.Trace.Println("Copyright (c) 2013-2015 Oryx(ossrs)")
	core.Trace.Println(fmt.Sprintf("go-oryx/%v is advanced SRS, focus on realtime live streaming.", core.Version()))

	if err := svr.Initialize(); err != nil {
		core.Error.Println("initialize server failed, err is", err)
		return -1
	}

	if err := svr.Run(); err != nil {
		core.Error.Println("run server failed, err is", err)
		return -1
	}

	return 0
}