MCPcopy
hub / github.com/aceld/zinx / NewUserConfDefaultRouterSlicesServer

Function NewUserConfDefaultRouterSlicesServer

znet/server.go:210–222  ·  view source on GitHub ↗

NewUserConfDefaultRouterSlicesServer creates a server handle with user-configured options and a default Recover handler. If the user does not wish to use the Use method, they should use NewUserConfServer instead. (创建一个用户配置的自带一个Recover处理器的服务器句柄,如果用户不希望Use这个方法,那么应该使用NewUserConfServer)

(config *zconf.Config, opts ...Option)

Source from the content-addressed store, hash-verified

208// If the user does not wish to use the Use method, they should use NewUserConfServer instead.
209// (创建一个用户配置的自带一个Recover处理器的服务器句柄,如果用户不希望Use这个方法,那么应该使用NewUserConfServer)
210func NewUserConfDefaultRouterSlicesServer(config *zconf.Config, opts ...Option) ziface.IServer {
211
212 if !config.RouterSlicesMode {
213 panic("RouterSlicesMode is false")
214 }
215
216 // Refresh user configuration to global configuration variable (刷新用户配置到全局配置变量)
217 zconf.UserConfToGlobal(config)
218
219 s := newServerWithConfig(zconf.GlobalObject, "tcp4", opts...)
220 s.Use(RouterRecovery)
221 return s
222}
223
224func (s *Server) StartConn(conn ziface.IConnection) {
225 // HeartBeat check

Callers

nothing calls this directly

Calls 3

UserConfToGlobalFunction · 0.92
newServerWithConfigFunction · 0.85
UseMethod · 0.65

Tested by

no test coverage detected