修复rpc问题

This commit is contained in:
1
2025-10-05 02:00:00 +00:00
parent a8098481d5
commit 4e2073e185
3 changed files with 11 additions and 16 deletions

View File

@@ -6,9 +6,9 @@ import (
"sync/atomic"
"time"
"blazing/cool"
"blazing/logic/service/player"
"github.com/gogf/gf/v2/os/glog"
"github.com/panjf2000/gnet/v2"
"github.com/panjf2000/gnet/v2/pkg/logging"
)
@@ -24,8 +24,9 @@ func (s *Server) Boot() error {
if err != nil {
return err
}
// err := gnet.Run(s, s.network+"://"+s.addr, gnet.WithMulticore(s.multicore))
glog.Debug(context.Background(), "server exits with error: %v", err)
cool.Loger.Debug(context.Background(), "server exits with error: %v", err)
// logging.Infof("server exits with error: %v", err)
return nil
}
@@ -56,13 +57,13 @@ func (s *Server) OnClose(c gnet.Conn, _ error) (action gnet.Action) {
return
}
func (s *Server) OnTick() (delay time.Duration, action gnet.Action) {
logging.Infof("[connected-count=%v]", atomic.LoadInt64(&s.connected))
cool.Loger.Infof(context.Background(), "[connected-count=%v]", atomic.LoadInt64(&s.connected))
return 10 * time.Second, gnet.None
}
func (s *Server) OnBoot(eng gnet.Engine) gnet.Action {
s.eng = eng
logging.Infof("syslog server is listening on %s\n", s.addr)
cool.Loger.Infof(context.Background(), "syslog server is listening on %s\n", s.addr)
return gnet.None
}