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)
| 208 | // If the user does not wish to use the Use method, they should use NewUserConfServer instead. |
| 209 | // (创建一个用户配置的自带一个Recover处理器的服务器句柄,如果用户不希望Use这个方法,那么应该使用NewUserConfServer) |
| 210 | func 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 | |
| 224 | func (s *Server) StartConn(conn ziface.IConnection) { |
| 225 | // HeartBeat check |
nothing calls this directly
no test coverage detected