package ziface type IServer interface { // Start 启动服务器 Start() // Stop 停止服务器 Stop() // Serve 运行服务器 Serve() // AddRouter 为服务注册路由方法,供客户端连接处理使用 AddRouter(msgID uint32, router IRouter) // GetConnMgr 取得连接管理器 GetConnMgr() IConnManager // SetOnConnStart 注册该服务器的连接创建时的钩子函数 SetOnConnStart(func(conn IConnection)) // SetOnConnStop 注册该服务器的连接断开时的钩子函数 SetOnConnStop(func(conn IConnection)) // CallOnConnStart 调用连接创建时的钩子函数 CallOnConnStart(conn IConnection) // CallOnConnStop 调用连接断开时的钩子函数 CallOnConnStop(conn IConnection) }