mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 13:03:22 +08:00
@@ -53,15 +53,17 @@ func (s *sTCPServer) Start(ctx context.Context) {
|
||||
})
|
||||
|
||||
// 服务监听
|
||||
if err := s.serv.Listen(); err != nil {
|
||||
g.Log().Warningf(ctx, "TCPServer Listen err:%v", err)
|
||||
if err = s.serv.Listen(); err != nil {
|
||||
if !s.serv.IsClose() {
|
||||
g.Log().Warningf(ctx, "TCPServer Listen err:%v", err)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Stop 关闭服务
|
||||
func (s *sTCPServer) Stop(ctx context.Context) {
|
||||
if s.serv != nil {
|
||||
if s.serv != nil && !s.serv.IsClose() {
|
||||
s.serv.Close()
|
||||
g.Log().Debug(ctx, "TCPServer stop..")
|
||||
}
|
||||
|
Reference in New Issue
Block a user