优化rpc-减少gc

This commit is contained in:
boyce
2020-11-04 15:06:39 +08:00
parent 2fc1217b18
commit 4d088d66da
4 changed files with 51 additions and 37 deletions

View File

@@ -30,7 +30,6 @@ type TcpGateService struct {
func (gateService *TcpGateService) OnInit() error {
gateService.OnLoad()
//注册监听客户连接断开事件
gateService.processor.SetDisConnectedHandler(gateService.router.OnDisconnected)
//注册监听客户连接事件
@@ -44,6 +43,10 @@ func (gateService *TcpGateService) OnInit() error {
return nil
}
func (gateService *TcpGateService) SetEventChannel(channelNum int){
gateService.GetEventProcessor().SetEventChannel(channelNum)
}
func (gateService *TcpGateService) OnLoad() {
//设置默认LoadBalance
if gateService.loadBalance == nil {