MCPcopy Create free account
hub / github.com/aceld/zinx / Serve

Method Serve

znet/server.go:470–478  ·  view source on GitHub ↗

Serve runs the server (运行服务)

()

Source from the content-addressed store, hash-verified

468
469// Serve runs the server (运行服务)
470func (s *Server) Serve() {
471 s.Start()
472 // Block, otherwise the listener's goroutine will exit when the main Go exits (阻塞,否则主Go退出, listenner的go将会退出)
473 c := make(chan os.Signal, 1)
474 // Listen for specified signals: ctrl+c or kill signal (监听指定信号 ctrl+c kill信号)
475 signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
476 sig := <-c
477 zlog.Ins().InfoF("[SERVE] Zinx server , name %s, Serve Interrupt, signal = %v", s.Name, sig)
478}
479
480func (s *Server) AddRouter(msgID uint32, router ziface.IRouter) {
481 if s.RouterSlicesMode {

Callers 15

mainFunction · 0.95
TestServerFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95

Calls 3

StartMethod · 0.95
InsFunction · 0.92
InfoFMethod · 0.65

Tested by 1

TestServerFunction · 0.76