代码拉取完成,页面将自动刷新
同步操作将从 BossHX/xingo 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package xingo
import (
_ "github.com/viphxin/xingo/fnet"
_ "github.com/viphxin/xingo/timer"
"github.com/viphxin/xingo/telnetcmd"
"github.com/viphxin/xingo/clusterserver"
"github.com/viphxin/xingo/sys_rpc"
"github.com/viphxin/xingo/utils"
"github.com/viphxin/xingo/fserver"
"github.com/viphxin/xingo/cluster"
"github.com/viphxin/xingo/logger"
"fmt"
"github.com/viphxin/xingo/iface"
)
func NewXingoTcpServer() iface.Iserver{
//do something
//debugport 是否开放
if utils.GlobalObject.DebugPort > 0{
if utils.GlobalObject.Host != ""{
fserver.NewTcpServer("telnet_server", "tcp4", utils.GlobalObject.Host,
utils.GlobalObject.DebugPort, 100, cluster.NewTelnetProtocol()).Start()
}else{
fserver.NewTcpServer("telnet_server", "tcp4", "127.0.0.1",
utils.GlobalObject.DebugPort, 100, cluster.NewTelnetProtocol()).Start()
}
logger.Debug(fmt.Sprintf("telnet tool start: %s:%d.", utils.GlobalObject.Host, utils.GlobalObject.DebugPort))
}
//add command
if utils.GlobalObject.CmdInterpreter != nil{
utils.GlobalObject.CmdInterpreter.AddCommand(telnetcmd.NewPprofCpuCommand())
}
s := fserver.NewServer()
return s
}
func NewXingoMaster(cfg string) *clusterserver.Master{
s := clusterserver.NewMaster(cfg)
//add rpc
s.AddRpcRouter(&sys_rpc.MasterRpc{})
//add command
if utils.GlobalObject.CmdInterpreter != nil{
utils.GlobalObject.CmdInterpreter.AddCommand(telnetcmd.NewPprofCpuCommand())
utils.GlobalObject.CmdInterpreter.AddCommand(telnetcmd.NewCloseServerCommand())
utils.GlobalObject.CmdInterpreter.AddCommand(telnetcmd.NewReloadCfgCommand())
}
return s
}
func NewXingoCluterServer(nodename, cfg string) *clusterserver.ClusterServer{
s := clusterserver.NewClusterServer(nodename,cfg)
//add rpc
s.AddRpcRouter(&sys_rpc.ChildRpc{})
s.AddRpcRouter(&sys_rpc.RootRpc{})
//add cmd
if utils.GlobalObject.CmdInterpreter != nil{
utils.GlobalObject.CmdInterpreter.AddCommand(telnetcmd.NewPprofCpuCommand())
}
return s
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。